Skip to content

Commit 748f733

Browse files
matheustavaresgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 47ae905 commit 748f733

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

entry.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,6 @@ int checkout_entry(struct cache_entry *ce, const struct checkout *state,
510510
/* If it is a gitlink, leave it alone! */
511511
if (S_ISGITLINK(ce->ce_mode))
512512
return 0;
513-
if (!state->force)
514-
return error("%s is a directory", path.buf);
515513
remove_subtree(&path);
516514
} else if (unlink(path.buf))
517515
return error_errno("unable to unlink old '%s'", path.buf);

0 commit comments

Comments
 (0)