summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc4263c)
raw | patch | inline | side by side (parent: fc4263c)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Mon, 20 Jun 2005 15:29:13 +0000 (08:29 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Mon, 20 Jun 2005 15:29:13 +0000 (08:29 -0700) |
This fixes "<hexsha1>..*", since get_sha1() will happily ignore any
garbage at the end and thus we never got to the ".." check before.
garbage at the end and thus we never got to the ".." check before.
rev-parse.c | patch | blob | history |
diff --git a/rev-parse.c b/rev-parse.c
index fd5f2ddca36ea45cd9feaf706a53aa66956db233..1f4f3240de895fe0f36cdd66ff435c6a10a19f2f 100644 (file)
--- a/rev-parse.c
+++ b/rev-parse.c
printf("%s\n", arg);
continue;
}
- if (!get_sha1(arg, sha1)) {
- if (no_revs)
- continue;
- def = NULL;
- printf("%s\n", sha1_to_hex(sha1));
- continue;
- }
- if (*arg == '^' && !get_sha1(arg+1, sha1)) {
- if (no_revs)
- continue;
- def = NULL;
- printf("^%s\n", sha1_to_hex(sha1));
- continue;
- }
dotdot = strstr(arg, "..");
if (dotdot) {
unsigned char end[20];
}
*dotdot = '.';
}
+ if (!get_sha1(arg, sha1)) {
+ if (no_revs)
+ continue;
+ def = NULL;
+ printf("%s\n", sha1_to_hex(sha1));
+ continue;
+ }
+ if (*arg == '^' && !get_sha1(arg+1, sha1)) {
+ if (no_revs)
+ continue;
+ def = NULL;
+ printf("^%s\n", sha1_to_hex(sha1));
+ continue;
+ }
if (revs_only)
continue;
def = NULL;