Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-03-21 21:30:10 +0300
committerJunio C Hamano <gitster@pobox.com>2018-03-21 21:30:10 +0300
commitbeb2cdf5041104a7513301a9b20944a617eec94e (patch)
tree6f44e7c048bc9857025235064b956a5d1d53ee25 /builtin/add.c
parent75901dfd52ef97df51621a23156db96c9cd4a90b (diff)
parent610008146ed1647bb1da6a098e314b8929ff213e (diff)
Merge branch 'ma/skip-writing-unchanged-index'
Internal API clean-up to allow write_locked_index() optionally skip writing the in-core index when it is not modified. * ma/skip-writing-unchanged-index: write_locked_index(): add flag to avoid writing unchanged index
Diffstat (limited to 'builtin/add.c')
-rw-r--r--builtin/add.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/add.c b/builtin/add.c
index ac7c1c32776..9ef7fb02d56 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -534,10 +534,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)
unplug_bulk_checkin();
finish:
- if (active_cache_changed) {
- if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
- die(_("Unable to write new index file"));
- }
+ if (write_locked_index(&the_index, &lock_file,
+ COMMIT_LOCK | SKIP_IF_UNCHANGED))
+ die(_("Unable to write new index file"));
UNLEAK(pathspec);
UNLEAK(dir);