X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=update-index.c;h=b825a11d2f6d8a53f5e42e4f157ba036a13edb59;hb=d9c74a808e988146edd1f4ae463285554cb024bd;hp=ade1ee72ebbe5e6b84a0c6645ff2043b831bdfef;hpb=5d1a5c02e8ac1c16688ea4a44512245f25a49f8a;p=git.git diff --git a/update-index.c b/update-index.c index ade1ee72..b825a11d 100644 --- a/update-index.c +++ b/update-index.c @@ -391,9 +391,11 @@ int main(int argc, const char **argv) update_one(buf.buf, prefix, prefix_length); } } - if (write_cache(newfd, active_cache, active_nr) || - commit_index_file(&cache_file)) - die("Unable to write new cachefile"); + if (active_cache_changed) { + if (write_cache(newfd, active_cache, active_nr) || + commit_index_file(&cache_file)) + die("Unable to write new cachefile"); + } return has_errors ? 1 : 0; }