summaryrefslogtreecommitdiff
path: root/builtin/worktree.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-07-08 10:35:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-08 17:11:27 (GMT)
commitdabd35f4cdd8bcfa502d082da5a3e4b927a2b329 (patch)
treef99ce3fa8296289ea5b7c0b4751d9bde34a19327 /builtin/worktree.c
parentfa262cac766d383c51e0ead04c62e114a79bd738 (diff)
downloadgit-dabd35f4cdd8bcfa502d082da5a3e4b927a2b329.zip
git-dabd35f4cdd8bcfa502d082da5a3e4b927a2b329.tar.gz
git-dabd35f4cdd8bcfa502d082da5a3e4b927a2b329.tar.bz2
avoid using sha1_to_hex output as printf format
We know that it should not contain any percent-signs, but it's a good habit not to feed non-literals to printf formatters. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/worktree.c')
-rw-r--r--builtin/worktree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c
index e866844..cce555c 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -262,7 +262,7 @@ static int add_worktree(const char *path, const char *refname,
*/
strbuf_reset(&sb);
strbuf_addf(&sb, "%s/HEAD", sb_repo.buf);
- write_file(sb.buf, sha1_to_hex(null_sha1));
+ write_file(sb.buf, "%s", sha1_to_hex(null_sha1));
strbuf_reset(&sb);
strbuf_addf(&sb, "%s/commondir", sb_repo.buf);
write_file(sb.buf, "../..");