sha1-name.c: remove the_repo from get_describe_name()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Apr 16, 2019 at 16:33 UTC
0c6b5ba1bbed9ba1bff9f1d879601755c13f291c
1 file changed
+5
-3
sha1-name.c
+5
-3
@@ -1097,7 +1097,9 @@ static int peel_onion(const char *name, int len, struct object_id *oid,
1097
return 0;
1098
}
1099
1100
-static int get_describe_name(const char *name, int len, struct object_id *oid)
1100
+static int get_describe_name(struct repository *r,
1101
+ const char *name, int len,
1102
+ struct object_id *oid)
1103
{
1104
const char *cp;
1105
unsigned flags = GET_OID_QUIETLY | GET_OID_COMMIT;
@@ -1111,7 +1113,7 @@ static int get_describe_name(const char *name, int len, struct object_id *oid)
1113
if (ch == 'g' && cp[-1] == '-') {
1114
cp++;
1115
len -= cp - name;
1114
- return get_short_oid(the_repository,
1116
+ return get_short_oid(r,
1117
cp, len, oid, flags);
1118
}
1119
}
@@ -1162,7 +1164,7 @@ static enum get_oid_result get_oid_1(const char *name, int len,
1164
return FOUND;
1165
1166
/* It could be describe output that is "SOMETHING-gXXXX" */
1165
- ret = get_describe_name(name, len, oid);
1167
+ ret = get_describe_name(the_repository, name, len, oid);
1168
if (!ret)
1169
return FOUND;
1170