diff options
Diffstat (limited to 'builtin/worktree.c')
-rw-r--r-- | builtin/worktree.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c index 430b51e7a7..71bb770f7a 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -238,7 +238,7 @@ static int add_worktree(const char *path, const char *refname, * after the preparation is over. */ strbuf_addf(&sb, "%s/locked", sb_repo.buf); - write_file(sb.buf, 1, "initializing\n"); + write_file(sb.buf, "initializing"); strbuf_addf(&sb_git, "%s/.git", path); if (safe_create_leading_directories_const(sb_git.buf)) @@ -248,8 +248,8 @@ static int add_worktree(const char *path, const char *refname, strbuf_reset(&sb); strbuf_addf(&sb, "%s/gitdir", sb_repo.buf); - write_file(sb.buf, 1, "%s\n", real_path(sb_git.buf)); - write_file(sb_git.buf, 1, "gitdir: %s/worktrees/%s\n", + write_file(sb.buf, "%s", real_path(sb_git.buf)); + write_file(sb_git.buf, "gitdir: %s/worktrees/%s", real_path(get_git_common_dir()), name); /* * This is to keep resolve_ref() happy. We need a valid HEAD @@ -260,10 +260,10 @@ 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, 1, "0000000000000000000000000000000000000000\n"); + write_file(sb.buf, "0000000000000000000000000000000000000000"); strbuf_reset(&sb); strbuf_addf(&sb, "%s/commondir", sb_repo.buf); - write_file(sb.buf, 1, "../..\n"); + write_file(sb.buf, "../.."); fprintf_ln(stderr, _("Preparing %s (identifier %s)"), path, name); |