Re: [PATCH] git-svn: fix ls-tree usage with dash-prefixed paths
- From
Björn Steinbrink <b.steinbrink@gmx.de>
- Date
- Mar 31, 2009, 09:41 UTC
- Message-ID
- <20090331094107.GC3307@atjola.homenet>
- In-Reply-To
- <20090331073147.GB3307@atjola.homenet>
On 2009.03.31 09:31:47 +0200, Björn Steinbrink wrote:
Show 27 quoted lines
> On 2009.03.31 09:11:00 +0200, Björn Steinbrink wrote:
> > And interestingly, the problem doesn't seem to be in
> > show_tree/show_recursive, but in match_tree_entry.
> >
> > With "git ls-tree HEAD gitweb/git-favicon.png g" we descend into gitweb/
> > and at some point we get:
> >
> > match = "g"
> > base = "gitweb/"
> >
> > And we have:
> > if (baselen >= matchlen) {
> > if (strncmp(base, match, matchlen))
> > continue;
> > /* The base is a subdirectory of a path which was specified */
> > return 1;
> > }
> >
> > So we return 1 there. The code doesn't do what the comment says, so I
> > guess we can be pretty sure that the behaviour is not intended.
>
> Yup, it's in match_tree_entry, you get the same thing with git show.
> With git.git, you can try with:
>
> git show 4fa535a -- Documentation/git-merge.txt D
>
> I'll try to get a patch done, if noone beats me to it.Ah, crap, "git show" actually uses a different function, tree_entry_interesting, which happens to have the same problem, but needs a slightly different fix.
Björn