summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Devin J. Pohly <djpohly@gmail.com>2017-02-23 02:27:34 -0600
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-03-03 12:43:37 -0800
commit4dacc8f11d4acfb43d76e2a1abc2d2a57d5a2691 (patch)
tree3d4e04a1614e29fd6522856446cb634d542af308
parentt7003: ensure --prune-empty can prune root commit (diff)
downloadtgif-4dacc8f11d4acfb43d76e2a1abc2d2a57d5a2691.tar.xz
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 <djpohly@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t7003-filter-branch.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 45372a1cba..40526d1716 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -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 &&