Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
sha1_name: convert uses of 40 to GIT_SHA1_HEXSZ
author
brian m. carlson
<sandals@crustytoothpaste.net>
Thu, 13 Jul 2017 23:49:30 +0000
(23:49 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 17 Jul 2017 20:54:51 +0000
(13:54 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
321c89b
)
diff --git
a/sha1_name.c
b/sha1_name.c
index 7577eaecfa382036c0ac0c1593a2f63388854564..862b6f1308e7031317ab6eb6d181652a6fc644ad 100644
(file)
--- a/
sha1_name.c
+++ b/
sha1_name.c
@@
-500,10
+500,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