Skip to content

Commit

Permalink
[PATCH] allow pathspec to end with a slash
Browse files Browse the repository at this point in the history
The recent rewrite broke "git-whatchanged -v -p drivers/usb/" but
"git-whatchanged -v -p drivers/usb" still works.  Just strip out the
trailing slashes internally to make it work again.

It uses compare-thing-with-number comparison order instead of visual
comparison order ;-).

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Junio C Hamano authored and Linus Torvalds committed May 27, 2005
1 parent fbe082a commit a9c9cef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion diffcore-pathspec.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ void diffcore_pathspec(const char **pathspec)
speccnt = i;
spec = xmalloc(sizeof(*spec) * speccnt);
for (i = 0; pathspec[i]; i++) {
int l;
spec[i].spec = pathspec[i];
spec[i].len = strlen(pathspec[i]);
l = strlen(pathspec[i]);
while (l > 0 && pathspec[i][l-1] == '/')
l--;
spec[i].len = l;
}

for (i = 0; i < q->nr; i++) {
Expand Down

0 comments on commit a9c9cef

Please sign in to comment.