diff options
Diffstat (limited to 'builtin/worktree.c')
-rw-r--r-- | builtin/worktree.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c index a5bb02b207..d6bc5263f1 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -10,7 +10,6 @@ #include "run-command.h" #include "sigchain.h" #include "submodule.h" -#include "refs.h" #include "utf8.h" #include "worktree.h" @@ -350,7 +349,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, "%s", sha1_to_hex(null_sha1)); + write_file(sb.buf, "%s", oid_to_hex(&null_oid)); strbuf_reset(&sb); strbuf_addf(&sb, "%s/commondir", sb_repo.buf); write_file(sb.buf, "../.."); @@ -377,7 +376,7 @@ static int add_worktree(const char *path, const char *refname, if (opts->checkout) { cp.argv = NULL; argv_array_clear(&cp.args); - argv_array_pushl(&cp.args, "reset", "--hard", NULL); + argv_array_pushl(&cp.args, "reset", "--hard", "--no-recurse-submodules", NULL); if (opts->quiet) argv_array_push(&cp.args, "--quiet"); cp.env = child_env.argv; @@ -880,7 +879,7 @@ static void check_clean_worktree(struct worktree *wt, original_path); ret = xread(cp.out, buf, sizeof(buf)); if (ret) - die(_("'%s' is dirty, use --force to delete it"), + die(_("'%s' contains modified or untracked files, use --force to delete it"), original_path); close(cp.out); ret = finish_command(&cp); |