summaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-03-22 17:40:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-22 18:00:07 (GMT)
commit626fd982a3ead1b0aae26c242fbabaaaaf4b6062 (patch)
tree12c58fe63551fab315317b09a52584fd760c1320 /sha1_name.c
parent1a750441a7360b29fff7a414649ece1d35acaca6 (diff)
downloadgit-626fd982a3ead1b0aae26c242fbabaaaaf4b6062.zip
git-626fd982a3ead1b0aae26c242fbabaaaaf4b6062.tar.gz
git-626fd982a3ead1b0aae26c242fbabaaaaf4b6062.tar.bz2
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>
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 39e911c..16e0003 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -480,7 +480,7 @@ struct min_abbrev_data {
unsigned int init_len;
unsigned int cur_len;
char *hex;
- const unsigned char *hash;
+ const struct object_id *oid;
};
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,
int cmp;
current = nth_packed_object_sha1(p, mid);
- cmp = hashcmp(mad->hash, current);
+ cmp = hashcmp(mad->oid->hash, current);
if (!cmp) {
match = 1;
first = mid;
@@ -603,7 +603,7 @@ int find_unique_abbrev_r(char *hex, const struct object_id *oid, int len)
mad.init_len = len;
mad.cur_len = len;
mad.hex = hex;
- mad.hash = oid->hash;
+ mad.oid = oid;
find_abbrev_len_packed(&mad);