summaryrefslogtreecommitdiff
path: root/builtin/worktree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-19 20:22:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-19 20:22:22 (GMT)
commit96e08010ee5b9d1dbfbcc8561fa69f972a415a38 (patch)
tree03768d6b32e30959c8c587fcd73ca3c1da8ae275 /builtin/worktree.c
parentf5236a776f31de2654bca9001aa74ef9fe0819d8 (diff)
parent54307ea7c3ced760ee375483a786ec7180798aed (diff)
downloadgit-96e08010ee5b9d1dbfbcc8561fa69f972a415a38.zip
git-96e08010ee5b9d1dbfbcc8561fa69f972a415a38.tar.gz
git-96e08010ee5b9d1dbfbcc8561fa69f972a415a38.tar.bz2
Merge branch 'jk/printf-format'
Code clean-up to avoid using a variable string that compilers may feel untrustable as printf-style format given to write_file() helper function. * jk/printf-format: commit.c: remove print_commit_list() avoid using sha1_to_hex output as printf format walker: let walker_say take arbitrary formats
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, "../..");