aboutsummaryrefslogtreecommitdiff
path: root/rev-list.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-09-16 17:53:19 -0700
committerJunio C Hamano <junkio@cox.net>2005-09-17 11:57:50 -0700
commit2a7055ae982fd66b078ac84cbb2b1f9408b67295 (patch)
tree3434a957859f191824b4adbad7641f89f0c97f74 /rev-list.c
parenta09af243fbffeb5ddc5dbc94a4bdf9201c346030 (diff)
downloadgit-2a7055ae982fd66b078ac84cbb2b1f9408b67295.tar.gz
git-2a7055ae982fd66b078ac84cbb2b1f9408b67295.tar.xz
[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>
Diffstat (limited to 'rev-list.c')
-rw-r--r--rev-list.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rev-list.c b/rev-list.c
index c55e912be..e41d5a045 100644
--- a/rev-list.c
+++ b/rev-list.c
@@ -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) {
@@ -569,7 +571,7 @@ int main(int argc, char **argv)
handle_one_commit(include, &list);
continue;
}
- *next = '.';
+ *dotdot = '.';
}
if (*arg == '^') {
flags = UNINTERESTING;