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 <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Mar 22, 2018 at 13:40 UTC
626fd982a3ead1b0aae26c242fbabaaaaf4b6062
1 file changed
+3
-3
sha1_name.c
+3
-3
@@ -480,7 +480,7 @@ struct min_abbrev_data {
480
unsigned int init_len;
481
unsigned int cur_len;
482
char *hex;
483
- const unsigned char *hash;
483
+ const struct object_id *oid;
484
};
485
486
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,
526
int cmp;
527
528
current = nth_packed_object_sha1(p, mid);
529
- cmp = hashcmp(mad->hash, current);
529
+ cmp = hashcmp(mad->oid->hash, current);
530
if (!cmp) {
531
match = 1;
532
first = mid;
@@ -603,7 +603,7 @@ int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len)
603
mad.init_len = len;
604
mad.cur_len = len;
605
mad.hex = hex;
606
- mad.hash = oid->hash;
606
+ mad.oid = oid;
607
608
find_abbrev_len_packed(&mad);
609