summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/checkout.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 4fbb9c13a1..3dc416c1e8 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -861,6 +861,8 @@ static int prepare_linked_checkout(const struct checkout_opts *opts,
if (!new->commit)
die(_("no branch specified"));
+ if (file_exists(path))
+ die(_("%s already exists"), path);
len = strlen(path);
while (len && is_dir_sep(path[len - 1]))