Hello!

Not sure if I’m doing something wrong here, but it seems that when
calling “git checkout <tree-ish> [--] <pathspec>”, the last argument
is not interpreted correctly.

I have a repository that contains a multi-module Maven project, and as
such it contains several “pom.xml” files, one in the root directory
and a few others in sub-directories. If I understand correctly the
documentation, calling “git checkout 0123abcdef -- :/**pom.xml” should
checkout (to the working tree and the index) all files named “pom.xml”
from revision 0123abcdef. As of version 2.23.0.windows.1 it only
checks out the “pom.xml” file from the root of the repository.

However, if I run “git checkout --patch 0123abcdef -- :/**pom.xml”,
then during the interactive process I am asked about changes from all
“pom.xml” files, everywhere in the directory hierarchy. (The short
form “-p” also works.) If I just type “a” at every prompt, I get what
I expected from the first command, i.e. all matching files in the
given revision.

(I just tested that version now because it’s the newest I can find.
But the issue happens since at least 2.20, probably earlier.)

Cheers,
—Bogdan Butnaru

Reply via email to