summaryrefslogtreecommitdiff
path: root/checkout-cache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-12 14:17:28 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-12 14:17:28 -0700
commit29d76d4b05bc537ac59fd1e6f849ab3386c01502 (patch)
treec48c95c3b53b9a16518955e1271ee3dfeb093f80 /checkout-cache.c
parent40e88b95cdce955059e94d288e8ebdb7d1e9fa88 (diff)
downloadgit-29d76d4b05bc537ac59fd1e6f849ab3386c01502.tar.gz
Make "checkout-cache" silently skip up-to-date files.
It used to always overwrite them if forced. Now it just realizes that they are already ok, and don't need to be touched.
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 73a1a8d668..6ed8b69eca 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;
}