summaryrefslogtreecommitdiff
path: root/builtin/rm.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-03-21 11:30:10 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-03-21 11:30:10 -0700
commitbeb2cdf5041104a7513301a9b20944a617eec94e (patch)
tree6f44e7c048bc9857025235064b956a5d1d53ee25 /builtin/rm.c
parentMerge branch 'ma/config-page-only-in-list-mode' (diff)
parentwrite_locked_index(): add flag to avoid writing unchanged index (diff)
downloadtgif-beb2cdf5041104a7513301a9b20944a617eec94e.tar.xz
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/rm.c')
-rw-r--r--builtin/rm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/rm.c b/builtin/rm.c
index a818efe230..4447bb4d0f 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -385,10 +385,9 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
stage_updated_gitmodules(&the_index);
}
- 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"));
return 0;
}