Skip to content

Commit

Permalink
mv: combine two if(s)
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Sep 3, 2014
1 parent b46b15d commit dcadc8b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions builtin/mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit dcadc8b

Please sign in to comment.