Commits

Linus Torvalds  committed 2a7055a

[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>

  • Participants
  • Parent commits a09af24

Comments (0)

Files changed (1)

 			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) {
 				handle_one_commit(include, &list);
 				continue;
 			}
-			*next = '.';
+			*dotdot = '.';
 		}
 		if (*arg == '^') {
 			flags = UNINTERESTING;