summaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-02 16:46:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-07-09 23:42:22 (GMT)
commite48ba200be908f02a3fb30adcbb8000b7100cb32 (patch)
tree7497dcbcc79bff3a394d958dfb6bcf523f86063c /sha1_name.c
parent6269b6b676310d9fa2560da49be618372b39acf4 (diff)
downloadgit-e48ba200be908f02a3fb30adcbb8000b7100cb32.zip
git-e48ba200be908f02a3fb30adcbb8000b7100cb32.tar.gz
git-e48ba200be908f02a3fb30adcbb8000b7100cb32.tar.bz2
sha1_name.c: get_sha1_1() takes lookup flags
This is to pass the disambiguation hints from the caller down the callchain. Nothing is changed in this step, as everybody just passes 0 in the flag. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sha1_name.c b/sha1_name.c
index caef6e5..8feb9b5 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -333,7 +333,7 @@ static inline int upstream_mark(const char *string, int len)
return 0;
}
-static int get_sha1_1(const char *name, int len, unsigned char *sha1);
+static int get_sha1_1(const char *name, int len, unsigned char *sha1, unsigned lookup_flags);
static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
{
@@ -370,7 +370,7 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
ret = interpret_branch_name(str+at, &buf);
if (ret > 0) {
/* substitute this branch name and restart */
- return get_sha1_1(buf.buf, buf.len, sha1);
+ return get_sha1_1(buf.buf, buf.len, sha1, 0);
} else if (ret == 0) {
return -1;
}
@@ -440,7 +440,7 @@ static int get_parent(const char *name, int len,
unsigned char *result, int idx)
{
unsigned char sha1[20];
- int ret = get_sha1_1(name, len, sha1);
+ int ret = get_sha1_1(name, len, sha1, 0);
struct commit *commit;
struct commit_list *p;
@@ -473,7 +473,7 @@ static int get_nth_ancestor(const char *name, int len,
struct commit *commit;
int ret;
- ret = get_sha1_1(name, len, sha1);
+ ret = get_sha1_1(name, len, sha1, 0);
if (ret)
return ret;
commit = lookup_commit_reference(sha1);
@@ -554,7 +554,7 @@ static int peel_onion(const char *name, int len, unsigned char *sha1)
else
return -1;
- if (get_sha1_1(name, sp - name - 2, outer))
+ if (get_sha1_1(name, sp - name - 2, outer, 0))
return -1;
o = parse_object(outer);
@@ -621,7 +621,7 @@ static int get_describe_name(const char *name, int len, unsigned char *sha1)
return -1;
}
-static int get_sha1_1(const char *name, int len, unsigned char *sha1)
+static int get_sha1_1(const char *name, int len, unsigned char *sha1, unsigned lookup_flags)
{
int ret, has_suffix;
const char *cp;
@@ -1098,7 +1098,7 @@ static int get_sha1_with_context_1(const char *name, unsigned char *sha1,
memset(oc, 0, sizeof(*oc));
oc->mode = S_IFINVALID;
- ret = get_sha1_1(name, namelen, sha1);
+ ret = get_sha1_1(name, namelen, sha1, 0);
if (!ret)
return ret;
/* sha1:path --> object name of path in ent sha1
@@ -1176,7 +1176,7 @@ static int get_sha1_with_context_1(const char *name, unsigned char *sha1,
strncpy(object_name, name, cp-name);
object_name[cp-name] = '\0';
}
- if (!get_sha1_1(name, cp-name, tree_sha1)) {
+ if (!get_sha1_1(name, cp-name, tree_sha1, 0)) {
const char *filename = cp+1;
char *new_filename = NULL;