]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7003: ensure --prune-empty removes entire branch when applicable
authorDevin J. Pohly <djpohly@gmail.com>
Thu, 23 Feb 2017 08:27:34 +0000 (02:27 -0600)
committerJunio C Hamano <gitster@pobox.com>
Fri, 3 Mar 2017 20:43:37 +0000 (12:43 -0800)
Sanity check before changing the logic in git_commit_non_empty_tree.

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7003-filter-branch.sh

index 45372a1cba4460e61c3ba253f68a25951c24c4eb..40526d17162a8cddd578477629376c21f4ec2489 100755 (executable)
@@ -371,6 +371,13 @@ test_expect_failure '--prune-empty is able to prune root commit' '
        test_cmp expect actual
 '
 
+test_expect_failure '--prune-empty is able to prune entire branch' '
+       git branch prune-entire B &&
+       git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
+       test_path_is_missing .git/refs/heads/prune-entire &&
+       test_must_fail git reflog exists refs/heads/prune-entire
+'
+
 test_expect_success '--remap-to-ancestor with filename filters' '
        git checkout master &&
        git reset --hard A &&