Browse Source

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.
maint
Linus Torvalds 20 years ago
parent
commit
29d76d4b05
  1. 6
      checkout-cache.c

6
checkout-cache.c

@ -96,12 +96,14 @@ static int write_entry(struct cache_entry *ce) @@ -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;

if (!stat(ce->name, &st)) {
unsigned changed = cache_match_stat(ce, &st);
if (changed && !quiet)
if (!changed)
return 0;
if (!force) {
if (!quiet)
fprintf(stderr, "checkout-cache: %s already exists\n", ce->name);
return 0;
}
Loading…
Cancel
Save