From b86339b12bc7ef179e2ce4096a5d1ede257ca4d2 Mon Sep 17 00:00:00 2001 From: Matheus Tavares Date: Fri, 20 Nov 2020 12:09:39 -0300 Subject: [PATCH] worktree: fix order of arguments in error message `git worktree add` (without --force) errors out when given a path that is already registered as a worktree and the path is missing on disk. But the `cmd` and `path` strings are switched on the error message. Let's fix that. Signed-off-by: Matheus Tavares Reviewed-by: Eric Sunshine Signed-off-by: Junio C Hamano --- builtin/worktree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index 99abaeec6c..8f39cb21ee 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -304,9 +304,9 @@ static void check_candidate_path(const char *path, } if (locked) - die(_("'%s' is a missing but locked worktree;\nuse '%s -f -f' to override, or 'unlock' and 'prune' or 'remove' to clear"), cmd, path); + die(_("'%s' is a missing but locked worktree;\nuse '%s -f -f' to override, or 'unlock' and 'prune' or 'remove' to clear"), path, cmd); else - die(_("'%s' is a missing but already registered worktree;\nuse '%s -f' to override, or 'prune' or 'remove' to clear"), cmd, path); + die(_("'%s' is a missing but already registered worktree;\nuse '%s -f' to override, or 'prune' or 'remove' to clear"), path, cmd); } static int add_worktree(const char *path, const char *refname,