Skip to content

Commit dcadc8b

Browse files
pcloudsgitster
authored andcommitted
mv: combine two if(s)
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b46b15d commit dcadc8b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

builtin/mv.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,9 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
274274
if (gitmodules_modified)
275275
stage_updated_gitmodules();
276276

277-
if (active_cache_changed) {
278-
if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
279-
die(_("Unable to write new index file"));
280-
}
277+
if (active_cache_changed &&
278+
write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
279+
die(_("Unable to write new index file"));
281280

282281
return 0;
283282
}

0 commit comments

Comments
 (0)