Skip to content

Commit

Permalink
[PATCH] Fix "git-rev-list" revision range parsing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Torvalds authored and Junio C Hamano committed Sep 17, 2005
1 parent a09af24 commit 2a7055a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ int main(int argc, char **argv)
struct commit *exclude = NULL;
struct commit *include = NULL;
*dotdot = 0;
if (!*next)
next = "HEAD";
exclude = get_commit_reference(arg, UNINTERESTING);
include = get_commit_reference(next, 0);
if (exclude && include) {
Expand All @@ -569,7 +571,7 @@ int main(int argc, char **argv)
handle_one_commit(include, &list);
continue;
}
*next = '.';
*dotdot = '.';
}
if (*arg == '^') {
flags = UNINTERESTING;
Expand Down

0 comments on commit 2a7055a

Please sign in to comment.