diff --git a/builtin-mv.c b/builtin-mv.c
index bce9959293e30925c4b16c40ac33a3f2e0474e30..8b81d4b51d78bb2aa49430102ab585afce9cccdf 100644 (file)
--- a/builtin-mv.c
+++ b/builtin-mv.c
if (read_cache() < 0)
die("index file corrupt");
if (read_cache() < 0)
die("index file corrupt");
- argc = parse_options(argc, argv, builtin_mv_options, builtin_mv_usage, 0);
+ argc = parse_options(argc, argv, prefix, builtin_mv_options,
+ builtin_mv_usage, 0);
if (--argc < 1)
usage_with_options(builtin_mv_usage, builtin_mv_options);
if (--argc < 1)
usage_with_options(builtin_mv_usage, builtin_mv_options);
}
argc += last - first;
}
}
argc += last - first;
}
- } else if (lstat(dst, &st) == 0) {
+ } else if (cache_name_pos(src, length) < 0)
+ bad = "not under version control";
+ else if (lstat(dst, &st) == 0) {
bad = "destination exists";
if (force) {
/*
bad = "destination exists";
if (force) {
/*
} else
bad = "Cannot overwrite";
}
} else
bad = "Cannot overwrite";
}
- } else if (cache_name_pos(src, length) < 0)
- bad = "not under version control";
- else if (string_list_has_string(&src_for_dst, dst))
+ } else if (string_list_has_string(&src_for_dst, dst))
bad = "multiple sources for the same target";
else
string_list_insert(dst, &src_for_dst);
bad = "multiple sources for the same target";
else
string_list_insert(dst, &src_for_dst);