[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>
This commit is contained in:

committed by
Junio C Hamano

parent
a09af243fb
commit
2a7055ae98
@ -561,6 +561,8 @@ int main(int argc, char **argv)
|
|||||||
struct commit *exclude = NULL;
|
struct commit *exclude = NULL;
|
||||||
struct commit *include = NULL;
|
struct commit *include = NULL;
|
||||||
*dotdot = 0;
|
*dotdot = 0;
|
||||||
|
if (!*next)
|
||||||
|
next = "HEAD";
|
||||||
exclude = get_commit_reference(arg, UNINTERESTING);
|
exclude = get_commit_reference(arg, UNINTERESTING);
|
||||||
include = get_commit_reference(next, 0);
|
include = get_commit_reference(next, 0);
|
||||||
if (exclude && include) {
|
if (exclude && include) {
|
||||||
@ -569,7 +571,7 @@ int main(int argc, char **argv)
|
|||||||
handle_one_commit(include, &list);
|
handle_one_commit(include, &list);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
*next = '.';
|
*dotdot = '.';
|
||||||
}
|
}
|
||||||
if (*arg == '^') {
|
if (*arg == '^') {
|
||||||
flags = UNINTERESTING;
|
flags = UNINTERESTING;
|
||||||
|
Reference in New Issue
Block a user