]> git.ipfire.org Git - thirdparty/git.git/commitdiff
checkout_entry(): remove unreachable error() call
authorMatheus Tavares <matheus.bernardino@usp.br>
Tue, 18 Aug 2020 17:46:55 +0000 (14:46 -0300)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Aug 2020 20:26:10 +0000 (13:26 -0700)
This if statement never evaluates to true since we already check
state->force a few lines above, and immediately return when it is
false.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
entry.c

diff --git a/entry.c b/entry.c
index 449bd32dee555d9a52481e30226cd4450e80409e..a0532f1f00007be7c9b675a54a7e8c48c000d638 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -510,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);