Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin/update-index: simplify parsing of cacheinfo
author
brian m. carlson
<sandals@crustytoothpaste.net>
Mon, 16 Jul 2018 01:28:01 +0000
(
01:28
+0000)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 16 Jul 2018 21:27:39 +0000
(14:27 -0700)
Switch from using get_oid_hex to parse_oid_hex to simplify pointer
operations and avoid the need for a hash-related constant.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/update-index.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
1928c94
)
diff --git
a/builtin/update-index.c
b/builtin/update-index.c
index 031cef5229cb7fb5d94d8a8184933a2f90af0f72..3206c5ad45910643f8e75d16b6b0af08f9ac1b00 100644
(file)
--- a/
builtin/update-index.c
+++ b/
builtin/update-index.c
@@
-827,6
+827,7
@@
static int parse_new_style_cacheinfo(const char *arg,
{
unsigned long ul;
char *endp;
+ const char *p;
if (!arg)
return -1;
@@
-837,9
+838,9
@@
static int parse_new_style_cacheinfo(const char *arg,
return -1; /* not a new-style cacheinfo */
*mode = ul;
endp++;
- if (
get_oid_hex(endp, oid) || endp[GIT_SHA1_HEXSZ]
!= ',')
+ if (
parse_oid_hex(endp, oid, &p) || *p
!= ',')
return -1;
- *path =
endp + GIT_SHA1_HEXSZ
+ 1;
+ *path =
p
+ 1;
return 0;
}