[PATCH v2 13/13] sha1_name: convert uses of 40 to GIT_SHA1_HEXSZ
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Jul 13, 2017, 23:49 UTC
- Message-ID
- <20170713234930.949612-14-sandals@crustytoothpaste.net>
- In-Reply-To
- <20170713234930.949612-1-sandals@crustytoothpaste.net>
There are several uses of the constant 40 in find_unique_abbrev_r. Convert them to GIT_SHA1_HEXSZ.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> --- sha1_name.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sha1_name.c b/sha1_name.c index b49303271e..8b7fd7e134 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -501,10 +501,10 @@ int find_unique_abbrev_r(char *hex, const unsigned char *sha1, int len) } sha1_to_hex_r(hex, sha1); - if (len == 40 || !len) - return 40; + if (len == GIT_SHA1_HEXSZ || !len) + return GIT_SHA1_HEXSZ; exists = has_sha1_file(sha1); - while (len < 40) { + while (len < GIT_SHA1_HEXSZ) { struct object_id oid_ret; status = get_short_oid(hex, len, &oid_ret, GET_OID_QUIETLY); if (exists