@matheusbsbs / matheus-bagliano / commits / 2a7055ae98
Fork 0

[PATCH] Fix "git-rev-list" revision range parsing

There were two bugs in there: - if the range didn't end up working, we restored the '.' character in the wrong place. - an empty end-of-range should be interpreted as HEAD. See rev-parse.c for the reference implementation of this. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Linus Torvalds committed Sep 16, 2005 at 17:53 UTC 2a7055ae982fd66b078ac84cbb2b1f9408b67295
1 file changed +3 -1
rev-list.c
+3 -1
@@ -561,6 +561,8 @@ int main(int argc, char **argv)
561 struct commit *exclude = NULL;
562 struct commit *include = NULL;
563 *dotdot = 0;
564 + if (!*next)
565 + next = "HEAD";
566 exclude = get_commit_reference(arg, UNINTERESTING);
567 include = get_commit_reference(next, 0);
568 if (exclude && include) {
@@ -569,7 +571,7 @@ int main(int argc, char **argv)
571 handle_one_commit(include, &list);
572 continue;
573 }
572 - *next = '.';
574 + *dotdot = '.';
575 }
576 if (*arg == '^') {
577 flags = UNINTERESTING;