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 <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matheus Tavares committed
Aug 18, 2020 at 14:46 UTC
748f733d542c8cca1013c1b0901cd96977a7ea11
1 file changed
-2
entry.c
-2
@@ -510,8 +510,6 @@ int checkout_entry(struct cache_entry *ce, const struct checkout *state,
510
/* If it is a gitlink, leave it alone! */
511
if (S_ISGITLINK(ce->ce_mode))
512
return 0;
513
- if (!state->force)
514
- return error("%s is a directory", path.buf);
513
remove_subtree(&path);
514
} else if (unlink(path.buf))
515
return error_errno("unable to unlink old '%s'", path.buf);