checkout: do not fail if target is an empty directory
[gitweb.git] / builtin / checkout.c
index 8c5276cf443f5d1e84cd5fd34e5f899afd3e58b6..953b76370be91563d4ec5a0ded3394d91b7d699b 100644 (file)
@@ -865,7 +865,7 @@ static int prepare_linked_checkout(const struct checkout_opts *opts,
 
        if (!new->commit)
                die(_("no branch specified"));
-       if (file_exists(path))
+       if (file_exists(path) && !is_empty_dir(path))
                die(_("'%s' already exists"), path);
 
        len = strlen(path);