Skip to content

Commit 4dacc8f

Browse files
djpohlygitster
authored andcommitted
t7003: ensure --prune-empty removes entire branch when applicable
Sanity check before changing the logic in git_commit_non_empty_tree. Signed-off-by: Devin J. Pohly <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 377a354 commit 4dacc8f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

t/t7003-filter-branch.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,13 @@ test_expect_failure '--prune-empty is able to prune root commit' '
371371
test_cmp expect actual
372372
'
373373

374+
test_expect_failure '--prune-empty is able to prune entire branch' '
375+
git branch prune-entire B &&
376+
git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
377+
test_path_is_missing .git/refs/heads/prune-entire &&
378+
test_must_fail git reflog exists refs/heads/prune-entire
379+
'
380+
374381
test_expect_success '--remap-to-ancestor with filename filters' '
375382
git checkout master &&
376383
git reset --hard A &&

0 commit comments

Comments
 (0)