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>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2014-08-10 09:29:35 +07:00 committed by Junio C Hamano
parent b46b15dea0
commit dcadc8b806

View File

@ -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))
if (active_cache_changed &&
write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
die(_("Unable to write new index file"));
}
return 0;
}