summaryrefslogtreecommitdiff
path: root/builtin-mv.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-mv.c')
-rw-r--r--builtin-mv.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/builtin-mv.c b/builtin-mv.c
index 736a0b8bb1..e66fa54324 100644
--- a/builtin-mv.c
+++ b/builtin-mv.c
@@ -228,15 +228,13 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
if (mode == WORKING_DIRECTORY)
continue;
- if (cache_name_pos(src, strlen(src)) >= 0) {
- string_list_insert(src, &deleted);
-
- /* destination can be a directory with 1 file inside */
- if (string_list_has_string(&overwritten, dst))
- string_list_insert(dst, &changed);
- else
- string_list_insert(dst, &added);
- } else
+ assert(cache_name_pos(src, strlen(src)) >= 0);
+
+ string_list_insert(src, &deleted);
+ /* destination can be a directory with 1 file inside */
+ if (string_list_has_string(&overwritten, dst))
+ string_list_insert(dst, &changed);
+ else
string_list_insert(dst, &added);
}