From 748f733d542c8cca1013c1b0901cd96977a7ea11 Mon Sep 17 00:00:00 2001 From: Matheus Tavares Date: Tue, 18 Aug 2020 14:46:55 -0300 Subject: [PATCH] checkout_entry(): remove unreachable error() call 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 Signed-off-by: Junio C Hamano --- entry.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/entry.c b/entry.c index 449bd32dee..a0532f1f00 100644 --- 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);