With an init file like
(require 'company)
(global-company-mode 1)
I run
mkdir ~/apple ~/apple/ball ~/apple/ball/caterpillar ~/apple/ball/catnip
emacs -q -l above-init.el
and start Eshell in the home directory. At the Eshell prompt, I type
apple/ball/cat
and am presented with two candidates for completion in the Company
popup. Choosing either one will complete with that subdirectory alone
(for example, "catnip/" instead of something like the desired
"/home/alice/apple/ball/catnip/").
This issue appears only in Emacs 28; if I perform the same experiment
with the latest rev of origin/emacs-27, the completion correctly
completes with the full path.