Skip to content

Commit 58ce21b

Browse files
bk2204gitster
authored andcommitted
builtin/mktree: remove hard-coded constant
Instead of using a hard-coded constant for the size of a hex object ID, switch to use the computed pointer from parse_oid_hex that points after the parsed object ID. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 2f0c9e9 commit 58ce21b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/mktree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static void mktree_line(char *buf, size_t len, int nul_term_line, int allow_miss
9898

9999
*ntr++ = 0; /* now at the beginning of SHA1 */
100100

101-
path = ntr + 41; /* at the beginning of name */
101+
path = (char *)p + 1; /* at the beginning of name */
102102
if (!nul_term_line && path[0] == '"') {
103103
struct strbuf p_uq = STRBUF_INIT;
104104
if (unquote_c_style(&p_uq, path, NULL))

0 commit comments

Comments
 (0)