mirror of
https://github.com/git/git
synced 2024-08-27 19:49:21 +00:00
Merge branch 'jc/denoise-rm-to-resolve'
"git rm" to resolve a conflicted path leaked an internal message "needs merge" before actually removing the path, which was confusing. This has been corrected. * jc/denoise-rm-to-resolve: rm: resolving by removal is not a warning-worthy event
This commit is contained in:
commit
5e9d9787d2
|
@ -273,7 +273,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
|
||||||
parse_pathspec(&pathspec, 0,
|
parse_pathspec(&pathspec, 0,
|
||||||
PATHSPEC_PREFER_CWD,
|
PATHSPEC_PREFER_CWD,
|
||||||
prefix, argv);
|
prefix, argv);
|
||||||
refresh_index(&the_index, REFRESH_QUIET, &pathspec, NULL, NULL);
|
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, &pathspec, NULL, NULL);
|
||||||
|
|
||||||
seen = xcalloc(pathspec.nr, 1);
|
seen = xcalloc(pathspec.nr, 1);
|
||||||
|
|
||||||
|
|
|
@ -252,6 +252,19 @@ test_expect_success 'choking "git rm" should not let it die with cruft' '
|
||||||
test_path_is_missing .git/index.lock
|
test_path_is_missing .git/index.lock
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'Resolving by removal is not a warning-worthy event' '
|
||||||
|
git reset -q --hard &&
|
||||||
|
test_when_finished "rm -f .git/index.lock msg && git reset -q --hard" &&
|
||||||
|
blob=$(echo blob | git hash-object -w --stdin) &&
|
||||||
|
for stage in 1 2 3
|
||||||
|
do
|
||||||
|
echo "100644 $blob $stage blob"
|
||||||
|
done | git update-index --index-info &&
|
||||||
|
git rm blob >msg 2>&1 &&
|
||||||
|
test_i18ngrep ! "needs merge" msg &&
|
||||||
|
test_must_fail git ls-files -s --error-unmatch blob
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'rm removes subdirectories recursively' '
|
test_expect_success 'rm removes subdirectories recursively' '
|
||||||
mkdir -p dir/subdir/subsubdir &&
|
mkdir -p dir/subdir/subsubdir &&
|
||||||
echo content >dir/subdir/subsubdir/file &&
|
echo content >dir/subdir/subsubdir/file &&
|
||||||
|
|
Loading…
Reference in a new issue