summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a8be83f)
raw | patch | inline | side by side (parent: a8be83f)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Tue, 21 Jun 2005 04:06:47 +0000 (21:06 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Tue, 21 Jun 2005 04:06:47 +0000 (21:06 -0700) |
The ".pN" thing might be a common ending of a tag, and in
contrast, ^ already is a special character for revisions
so use that instead.
contrast, ^ already is a special character for revisions
so use that instead.
rev-parse.c | patch | blob | history |
diff --git a/rev-parse.c b/rev-parse.c
index 1b08b455811d914ba88ba138b1c0187ac6e20d58..40707ac6ca7258878b47ed72074b3cf7364d3a56 100644 (file)
--- a/rev-parse.c
+++ b/rev-parse.c
/*
* This is like "get_sha1()", except it allows "sha1 expressions",
- * notably "xyz.p" for "parent of xyz"
+ * notably "xyz^" for "parent of xyz"
*/
static int get_extended_sha1(char *name, unsigned char *sha1)
{
int len = strlen(name);
parent = 1;
- if (len > 3 && name[len-1] >= '1' && name[len-1] <= '9') {
+ if (len > 2 && name[len-1] >= '1' && name[len-1] <= '9') {
parent = name[len-1] - '0';
len--;
}
- if (len > 2 && !memcmp(name + len - 2, ".p", 2)) {
+ if (len > 1 && name[len-1] == '^') {
int ret;
- name[len-2] = 0;
+ name[len-1] = 0;
ret = get_parent(name, sha1, parent);
- name[len-2] = '.';
+ name[len-1] = '^';
if (!ret)
return 0;
}