summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fbe082a)
raw | patch | inline | side by side (parent: fbe082a)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 27 May 2005 00:52:43 +0000 (17:52 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Fri, 27 May 2005 01:50:38 +0000 (18:50 -0700) |
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>
"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>
diffcore-pathspec.c | patch | blob | history |
diff --git a/diffcore-pathspec.c b/diffcore-pathspec.c
index 78b3cb4c0a61f029bf6ccc3977933c2bef3303e3..fd11822aaf1a543f14f074d6975f5e55ef95c73a 100644 (file)
--- a/diffcore-pathspec.c
+++ b/diffcore-pathspec.c
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++) {