]> git.ipfire.org Git - thirdparty/git.git/commitdiff
worktree: fix order of arguments in error message
authorMatheus Tavares <matheus.bernardino@usp.br>
Fri, 20 Nov 2020 15:09:39 +0000 (12:09 -0300)
committerJunio C Hamano <gitster@pobox.com>
Sat, 21 Nov 2020 21:31:34 +0000 (13:31 -0800)
`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 <matheus.bernardino@usp.br>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c

index 99abaeec6c6edcb5a16e0d5e7439981f81561319..8f39cb21eeea575798f71c26daafd2e33e0d6ab9 100644 (file)
@@ -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,