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>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2019-04-16 16:33:30 +07:00 коммит произвёл Junio C Hamano
Родитель 0bb41a1985
Коммит 0c6b5ba1bb
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -1097,7 +1097,9 @@ static int peel_onion(const char *name, int len, struct object_id *oid,
return 0; return 0;
} }
static int get_describe_name(const char *name, int len, struct object_id *oid) static int get_describe_name(struct repository *r,
const char *name, int len,
struct object_id *oid)
{ {
const char *cp; const char *cp;
unsigned flags = GET_OID_QUIETLY | GET_OID_COMMIT; 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)
if (ch == 'g' && cp[-1] == '-') { if (ch == 'g' && cp[-1] == '-') {
cp++; cp++;
len -= cp - name; len -= cp - name;
return get_short_oid(the_repository, return get_short_oid(r,
cp, len, oid, flags); cp, len, oid, flags);
} }
} }
@ -1162,7 +1164,7 @@ static enum get_oid_result get_oid_1(const char *name, int len,
return FOUND; return FOUND;
/* It could be describe output that is "SOMETHING-gXXXX" */ /* It could be describe output that is "SOMETHING-gXXXX" */
ret = get_describe_name(name, len, oid); ret = get_describe_name(the_repository, name, len, oid);
if (!ret) if (!ret)
return FOUND; return FOUND;