зеркало из https://github.com/microsoft/git.git
Merge branch 'sm/mv-dry-run-update'
Code clean-up. * sm/mv-dry-run-update: mv: remove unneeded 'if (!show_only)' t7001: add test case for --dry-run
This commit is contained in:
Коммит
a4ae2e5a1c
|
@ -286,8 +286,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
|
||||||
|
|
||||||
pos = cache_name_pos(src, strlen(src));
|
pos = cache_name_pos(src, strlen(src));
|
||||||
assert(pos >= 0);
|
assert(pos >= 0);
|
||||||
if (!show_only)
|
rename_cache_entry_at(pos, dst);
|
||||||
rename_cache_entry_at(pos, dst);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gitmodules_modified)
|
if (gitmodules_modified)
|
||||||
|
|
|
@ -38,6 +38,12 @@ test_expect_success \
|
||||||
'git diff-tree -r -M --name-status HEAD^ HEAD | \
|
'git diff-tree -r -M --name-status HEAD^ HEAD | \
|
||||||
grep "^R100..*path1/COPYING..*path0/COPYING"'
|
grep "^R100..*path1/COPYING..*path0/COPYING"'
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'mv --dry-run does not move file' \
|
||||||
|
'git mv -n path0/COPYING MOVED &&
|
||||||
|
test -f path0/COPYING &&
|
||||||
|
test ! -f MOVED'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
'checking -k on non-existing file' \
|
'checking -k on non-existing file' \
|
||||||
'git mv -k idontexist path0'
|
'git mv -k idontexist path0'
|
||||||
|
|
Загрузка…
Ссылка в новой задаче