Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-10-15 03:01:51 +0300
committerJunio C Hamano <gitster@pobox.com>2018-10-15 06:53:15 +0300
commit58ce21b819e582db2a96d170fdd24d3f7bc6c4d0 (patch)
tree9b09c4fe4b90da7dad55c56c78690018eb24e185 /builtin/mktree.c
parent2f0c9e9a9bbe8015da2c0838f3051c0a336dee26 (diff)
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>
Diffstat (limited to 'builtin/mktree.c')
-rw-r--r--builtin/mktree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/mktree.c b/builtin/mktree.c
index 2dc4ad6ba8..94e82b8504 100644
--- a/builtin/mktree.c
+++ b/builtin/mktree.c
@@ -98,7 +98,7 @@ static void mktree_line(char *buf, size_t len, int nul_term_line, int allow_miss
*ntr++ = 0; /* now at the beginning of SHA1 */
- path = ntr + 41; /* at the beginning of name */
+ path = (char *)p + 1; /* at the beginning of name */
if (!nul_term_line && path[0] == '"') {
struct strbuf p_uq = STRBUF_INIT;
if (unquote_c_style(&p_uq, path, NULL))