diff options
Diffstat (limited to 'builtin/mv.c')
-rw-r--r-- | builtin/mv.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/builtin/mv.c b/builtin/mv.c index edd7b931fd..22e64fc290 100644 --- a/builtin/mv.c +++ b/builtin/mv.c @@ -5,13 +5,21 @@ */ #define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" +#include "advice.h" #include "config.h" +#include "environment.h" +#include "gettext.h" +#include "name-hash.h" +#include "object-file.h" #include "pathspec.h" #include "lockfile.h" #include "dir.h" -#include "cache-tree.h" #include "string-list.h" #include "parse-options.h" +#include "read-cache-ll.h" +#include "repository.h" +#include "setup.h" #include "submodule.h" #include "entry.h" @@ -175,7 +183,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix) int src_dir_nr = 0, src_dir_alloc = 0; struct strbuf a_src_dir = STRBUF_INIT; enum update_mode *modes, dst_mode = 0; - struct stat st; + struct stat st, dest_st; struct string_list src_for_dst = STRING_LIST_INIT_NODUP; struct lock_file lock_file = LOCK_INIT; struct cache_entry *ce; @@ -295,8 +303,8 @@ int cmd_mv(int argc, const char **argv, const char *prefix) goto act_on_entry; } if (S_ISDIR(st.st_mode) - && lstat(dst, &st) == 0) { - bad = _("cannot move directory over file"); + && lstat(dst, &dest_st) == 0) { + bad = _("destination already exists"); goto act_on_entry; } |