mirror of
https://github.com/git/git.git
synced 2024-10-31 14:27:54 +01:00
Merge branch 'sg/filter-branch-dwim-ambiguity' into maint
Fix for a corner case in filter-branch. * sg/filter-branch-dwim-ambiguity: filter-branch: deal with object name vs. pathname ambiguity in tree-filter
This commit is contained in:
commit
978b5760a1
2 changed files with 8 additions and 1 deletions
|
@ -319,7 +319,7 @@ while read commit parents; do
|
|||
die "tree filter failed: $filter_tree"
|
||||
|
||||
(
|
||||
git diff-index -r --name-only --ignore-submodules $commit &&
|
||||
git diff-index -r --name-only --ignore-submodules $commit -- &&
|
||||
git ls-files --others
|
||||
) > "$tempdir"/tree-state || exit
|
||||
git update-index --add --replace --remove --stdin \
|
||||
|
|
|
@ -418,4 +418,11 @@ test_expect_success 'filter commit message without trailing newline' '
|
|||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success 'tree-filter deals with object name vs pathname ambiguity' '
|
||||
test_when_finished "git reset --hard original" &&
|
||||
ambiguous=$(git rev-list -1 HEAD) &&
|
||||
git filter-branch --tree-filter "mv file.t $ambiguous" HEAD^.. &&
|
||||
git show HEAD:$ambiguous
|
||||
'
|
||||
|
||||
test_done
|
||||
|
|
Loading…
Reference in a new issue