summaryrefslogtreecommitdiff
path: root/builtin/mv.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-08-10 02:29:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-09-03 22:06:59 (GMT)
commitdcadc8b80609f6857ab35163a8a6e08cdaf35b8f (patch)
tree6d8237aba79abd89acf87d8cedfa60b61071325b /builtin/mv.c
parentb46b15dea01a898888fac977aeed6055a761c3ca (diff)
downloadgit-dcadc8b80609f6857ab35163a8a6e08cdaf35b8f.zip
git-dcadc8b80609f6857ab35163a8a6e08cdaf35b8f.tar.gz
git-dcadc8b80609f6857ab35163a8a6e08cdaf35b8f.tar.bz2
mv: combine two if(s)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/mv.c')
-rw-r--r--builtin/mv.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/mv.c b/builtin/mv.c
index 4f324ae..e253550 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -274,10 +274,9 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
if (gitmodules_modified)
stage_updated_gitmodules();
- if (active_cache_changed) {
- if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
- die(_("Unable to write new index file"));
- }
+ if (active_cache_changed &&
+ write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
+ die(_("Unable to write new index file"));
return 0;
}