summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5d1a5c0)
raw | patch | inline | side by side (parent: 5d1a5c0)
author | Linus Torvalds <torvalds@osdl.org> | |
Sat, 1 Oct 2005 20:39:47 +0000 (13:39 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 2 Oct 2005 06:56:16 +0000 (23:56 -0700) |
This makes "git-update-index" avoid the new index file write if it didn't
make any changes to the index.
It still doesn't make things like "git status" be read-only operations in
general, but if the index file doesn't need refreshing, it now will at
least avoid making unnecessary changes.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
make any changes to the index.
It still doesn't make things like "git status" be read-only operations in
general, but if the index file doesn't need refreshing, it now will at
least avoid making unnecessary changes.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
update-index.c | patch | blob | history |
diff --git a/update-index.c b/update-index.c
index ade1ee72ebbe5e6b84a0c6645ff2043b831bdfef..b825a11d2f6d8a53f5e42e4f157ba036a13edb59 100644 (file)
--- a/update-index.c
+++ b/update-index.c
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;
}