Merge branch 'jk/filter-branch-no-index' into maint
A recent optimization to filter-branch in v2.7.0 introduced a regression when --prune-empty filter is used, which has been corrected. * jk/filter-branch-no-index: filter-branch: resolve $commit^{tree} in no-index case
This commit is contained in:
commit
16f5e26833
@ -404,7 +404,7 @@ while read commit parents; do
|
|||||||
then
|
then
|
||||||
tree=$(git write-tree)
|
tree=$(git write-tree)
|
||||||
else
|
else
|
||||||
tree="$commit^{tree}"
|
tree=$(git rev-parse "$commit^{tree}")
|
||||||
fi
|
fi
|
||||||
workdir=$workdir @SHELL_PATH@ -c "$filter_commit" "git commit-tree" \
|
workdir=$workdir @SHELL_PATH@ -c "$filter_commit" "git commit-tree" \
|
||||||
"$tree" $parentstr < ../message > ../map/$commit ||
|
"$tree" $parentstr < ../message > ../map/$commit ||
|
||||||
|
@ -333,6 +333,14 @@ test_expect_success 'prune empty collapsed merges' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'prune empty works even without index/tree filters' '
|
||||||
|
git rev-list HEAD >expect &&
|
||||||
|
git commit --allow-empty -m empty &&
|
||||||
|
git filter-branch -f --prune-empty HEAD &&
|
||||||
|
git rev-list HEAD >actual &&
|
||||||
|
test_cmp expect actual
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success '--remap-to-ancestor with filename filters' '
|
test_expect_success '--remap-to-ancestor with filename filters' '
|
||||||
git checkout master &&
|
git checkout master &&
|
||||||
git reset --hard A &&
|
git reset --hard A &&
|
||||||
|
Loading…
Reference in New Issue
Block a user