Skip to content

Commit 626fd98

Browse files
bk2204gitster
authored andcommitted
sha1_name: convert struct min_abbrev_data to object_id
This structure is only written to in one place, where we already have a struct object_id. Convert the struct to use a struct object_id instead. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1a75044 commit 626fd98

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sha1_name.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ struct min_abbrev_data {
480480
unsigned int init_len;
481481
unsigned int cur_len;
482482
char *hex;
483-
const unsigned char *hash;
483+
const struct object_id *oid;
484484
};
485485

486486
static inline char get_hex_char_from_oid(const struct object_id *oid,
@@ -526,7 +526,7 @@ static void find_abbrev_len_for_pack(struct packed_git *p,
526526
int cmp;
527527

528528
current = nth_packed_object_sha1(p, mid);
529-
cmp = hashcmp(mad->hash, current);
529+
cmp = hashcmp(mad->oid->hash, current);
530530
if (!cmp) {
531531
match = 1;
532532
first = mid;
@@ -603,7 +603,7 @@ int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len)
603603
mad.init_len = len;
604604
mad.cur_len = len;
605605
mad.hex = hex;
606-
mad.hash = oid->hash;
606+
mad.oid = oid;
607607

608608
find_abbrev_len_packed(&mad);
609609

0 commit comments

Comments
 (0)