]> git.ipfire.org Git - thirdparty/git.git/blobdiff - entry.c
git-worktree.txt: discuss branch-based vs. throwaway worktrees
[thirdparty/git.git] / entry.c
diff --git a/entry.c b/entry.c
index 00b49033668160574c35555293c0c755cbafaeaa..a0532f1f00007be7c9b675a54a7e8c48c000d638 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -113,8 +113,7 @@ static int fstat_output(int fd, const struct checkout *state, struct stat *st)
        /* use fstat() only when path == ce->name */
        if (fstat_is_reliable() &&
            state->refresh_cache && !state->base_dir_len) {
-               fstat(fd, st);
-               return 1;
+               return !fstat(fd, st);
        }
        return 0;
 }
@@ -511,8 +510,6 @@ int checkout_entry(struct cache_entry *ce, const struct checkout *state,
                        /* If it is a gitlink, leave it alone! */
                        if (S_ISGITLINK(ce->ce_mode))
                                return 0;
-                       if (!state->force)
-                               return error("%s is a directory", path.buf);
                        remove_subtree(&path);
                } else if (unlink(path.buf))
                        return error_errno("unable to unlink old '%s'", path.buf);