Skip to content

Commit e48ba20

Browse files
committed
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 <[email protected]>
1 parent 6269b6b commit e48ba20

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sha1_name.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ static inline int upstream_mark(const char *string, int len)
333333
return 0;
334334
}
335335

336-
static int get_sha1_1(const char *name, int len, unsigned char *sha1);
336+
static int get_sha1_1(const char *name, int len, unsigned char *sha1, unsigned lookup_flags);
337337

338338
static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
339339
{
@@ -370,7 +370,7 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
370370
ret = interpret_branch_name(str+at, &buf);
371371
if (ret > 0) {
372372
/* substitute this branch name and restart */
373-
return get_sha1_1(buf.buf, buf.len, sha1);
373+
return get_sha1_1(buf.buf, buf.len, sha1, 0);
374374
} else if (ret == 0) {
375375
return -1;
376376
}
@@ -440,7 +440,7 @@ static int get_parent(const char *name, int len,
440440
unsigned char *result, int idx)
441441
{
442442
unsigned char sha1[20];
443-
int ret = get_sha1_1(name, len, sha1);
443+
int ret = get_sha1_1(name, len, sha1, 0);
444444
struct commit *commit;
445445
struct commit_list *p;
446446

@@ -473,7 +473,7 @@ static int get_nth_ancestor(const char *name, int len,
473473
struct commit *commit;
474474
int ret;
475475

476-
ret = get_sha1_1(name, len, sha1);
476+
ret = get_sha1_1(name, len, sha1, 0);
477477
if (ret)
478478
return ret;
479479
commit = lookup_commit_reference(sha1);
@@ -554,7 +554,7 @@ static int peel_onion(const char *name, int len, unsigned char *sha1)
554554
else
555555
return -1;
556556

557-
if (get_sha1_1(name, sp - name - 2, outer))
557+
if (get_sha1_1(name, sp - name - 2, outer, 0))
558558
return -1;
559559

560560
o = parse_object(outer);
@@ -621,7 +621,7 @@ static int get_describe_name(const char *name, int len, unsigned char *sha1)
621621
return -1;
622622
}
623623

624-
static int get_sha1_1(const char *name, int len, unsigned char *sha1)
624+
static int get_sha1_1(const char *name, int len, unsigned char *sha1, unsigned lookup_flags)
625625
{
626626
int ret, has_suffix;
627627
const char *cp;
@@ -1098,7 +1098,7 @@ static int get_sha1_with_context_1(const char *name, unsigned char *sha1,
10981098

10991099
memset(oc, 0, sizeof(*oc));
11001100
oc->mode = S_IFINVALID;
1101-
ret = get_sha1_1(name, namelen, sha1);
1101+
ret = get_sha1_1(name, namelen, sha1, 0);
11021102
if (!ret)
11031103
return ret;
11041104
/* 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,
11761176
strncpy(object_name, name, cp-name);
11771177
object_name[cp-name] = '\0';
11781178
}
1179-
if (!get_sha1_1(name, cp-name, tree_sha1)) {
1179+
if (!get_sha1_1(name, cp-name, tree_sha1, 0)) {
11801180
const char *filename = cp+1;
11811181
char *new_filename = NULL;
11821182

0 commit comments

Comments
 (0)