summaryrefslogtreecommitdiff
path: root/checkout-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'checkout-cache.c')
-rw-r--r--checkout-cache.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/checkout-cache.c b/checkout-cache.c
index 73a1a8d..6ed8b69 100644
--- a/checkout-cache.c
+++ b/checkout-cache.c
@@ -96,12 +96,14 @@ static int write_entry(struct cache_entry *ce)
static int checkout_entry(struct cache_entry *ce)
{
- if (!force) {
- struct stat st;
+ struct stat st;
- if (!stat(ce->name, &st)) {
- unsigned changed = cache_match_stat(ce, &st);
- if (changed && !quiet)
+ if (!stat(ce->name, &st)) {
+ unsigned changed = cache_match_stat(ce, &st);
+ if (!changed)
+ return 0;
+ if (!force) {
+ if (!quiet)
fprintf(stderr, "checkout-cache: %s already exists\n", ce->name);
return 0;
}