From: Nguyễn Thái Ngọc Duy Date: Tue, 29 Jul 2014 13:50:31 GMT Subject: [PATCH v2 8/8] checkout --to: do not touch existing target directory Message-ID: <1406641831-2390-9-git-send-email-pclouds@gmail.com> In-Reply-To: <1406641831-2390-1-git-send-email-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/checkout.c b/builtin/checkout.c index 4fbb9c1..3dc416c 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])) -- 2.1.0.rc0.78.gc0d8480