summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2019-08-13 18:02:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-13 20:10:09 (GMT)
commit507e5470a0e8be7e2a50a5ffe1f690d06dc00056 (patch)
treecb64a078c739605a596ccbcc022039dedef0720b /builtin
parentff66981f4593aec0f3b3eeace0eacb7dbe44fd8c (diff)
downloadgit-507e5470a0e8be7e2a50a5ffe1f690d06dc00056.zip
git-507e5470a0e8be7e2a50a5ffe1f690d06dc00056.tar.gz
git-507e5470a0e8be7e2a50a5ffe1f690d06dc00056.tar.bz2
worktree remove: clarify error message on dirty worktree
To avoid data loss, 'git worktree remove' refuses to delete a worktree if it's dirty or contains untracked files. However, the error message only mentions that the worktree "is dirty", even if the worktree in question is in fact clean, but contains untracked files: $ git worktree add test-worktree Preparing worktree (new branch 'test-worktree') HEAD is now at aa53e60 Initial $ >test-worktree/untracked-file $ git worktree remove test-worktree/ fatal: 'test-worktree/' is dirty, use --force to delete it $ git -C test-worktree/ diff $ git -C test-worktree/ diff --cached $ # Huh? Where are those dirty files?! Clarify this error message to say that the worktree "contains modified or untracked files". Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/worktree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c
index a5bb02b..7f094f8 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -880,7 +880,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);