From: Junio C Hamano Date: Sun, 09 Dec 2007 03:22:49 GMT Subject: Re: [PATCH] Restore ls-remote reference pattern matching Message-ID: <7vodd0tuuu.fsf@gitster.siamese.dyndns.org> In-Reply-To: Daniel Barkalow writes: > How's this? I vaguely tested it, and it doesn't break existing tests, and > it matches my guess at how the old code worked, at least maybe. Well, contrib/examples/git-ls-remote.sh is your friend and you do not have to "guess". It did, for each ref $path it got from peek-remote, this: for pat do case "/$path" in */$pat ) match=yes break ;; esac done I do not think pathspec_match() matches the string in a way compatible with the above loop, and calling get_pathspec(prefix, argv) with anything but a real path is a misuse of the interface. I think if you do fnmatch(3) that would be compatible with the shell loop.