From 4b12dae69a41471e7c8139de26c1135f7ecccbd8 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 3 Oct 2005 12:44:48 -0700 Subject: Return error when not checking out an entry due to dirtiness. Without -f flag, 'git-checkout-index foo.c' issued an error message when foo.c already existed in the working tree and did not match index. However it did not return an error from the underlying checkout_entry() function and resulted in a successful exit(0). Signed-off-by: Junio C Hamano --- entry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'entry.c') diff --git a/entry.c b/entry.c index b8426dbd0d..15b34eb6f9 100644 --- a/entry.c +++ b/entry.c @@ -132,7 +132,7 @@ int checkout_entry(struct cache_entry *ce, struct checkout *state) if (!state->force) { if (!state->quiet) fprintf(stderr, "git-checkout-index: %s already exists\n", path); - return 0; + return -1; } /* -- cgit v1.2.3