MCPcopy Create free account
hub / github.com/git/git / get_describe_name

Function get_describe_name

object-name.c:1059–1082  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1057}
1058
1059static int get_describe_name(struct repository *r,
1060 const char *name, int len,
1061 struct object_id *oid)
1062{
1063 const char *cp;
1064 unsigned flags = GET_OID_QUIETLY | GET_OID_COMMIT;
1065
1066 for (cp = name + len - 1; name + 2 <= cp; cp--) {
1067 char ch = *cp;
1068 if (!isxdigit(ch)) {
1069 /* We must be looking at g in "SOMETHING-g"
1070 * for it to be describe output.
1071 */
1072 if (ch == 'g' && cp[-1] == '-' &&
1073 ref_and_count_parts_valid(name, cp - 1 - name)) {
1074 cp++;
1075 len -= cp - name;
1076 return get_short_oid(r,
1077 cp, len, oid, flags);
1078 }
1079 }
1080 }
1081 return -1;
1082}
1083
1084static enum get_oid_result get_oid_1(struct repository *r,
1085 const char *name, int len,

Callers 1

get_oid_1Function · 0.85

Calls 2

get_short_oidFunction · 0.85

Tested by

no test coverage detected