rebase: fix documentation formatting
[gitweb.git] / t / t7003-filter-branch.sh
index 7cb60799be1a109e2210350137c8754a5bc4bb7d..ec4b160ddb9f966044e729f35cc1edfcc79eed14 100755 (executable)
@@ -187,7 +187,8 @@ test_expect_success 'author information is preserved' '
                        test \$GIT_COMMIT != $(git rev-parse master) || \
                        echo Hallo" \
                preserved-author) &&
-       test 1 = $(git rev-list --author="B V Uips" preserved-author | wc -l)
+       git rev-list --author="B V Uips" preserved-author >actual &&
+       test_line_count = 1 actual
 '
 
 test_expect_success "remove a certain author's commits" '
@@ -205,7 +206,8 @@ test_expect_success "remove a certain author's commits" '
        cnt1=$(git rev-list master | wc -l) &&
        cnt2=$(git rev-list removed-author | wc -l) &&
        test $cnt1 -eq $(($cnt2 + 1)) &&
-       test 0 = $(git rev-list --author="B V Uips" removed-author | wc -l)
+       git rev-list --author="B V Uips" removed-author >actual &&
+       test_line_count = 0 actual
 '
 
 test_expect_success 'barf on invalid name' '
@@ -258,7 +260,8 @@ test_expect_success 'Subdirectory filter with disappearing trees' '
        git commit -m "Re-adding foo" &&
 
        git filter-branch -f --subdirectory-filter foo &&
-       test $(git rev-list master | wc -l) = 3
+       git rev-list master >actual &&
+       test_line_count = 3 actual
 '
 
 test_expect_success 'Tag name filtering retains tag message' '
@@ -470,4 +473,18 @@ test_expect_success 'tree-filter deals with object name vs pathname ambiguity' '
        git show HEAD:$ambiguous
 '
 
+test_expect_success 'rewrite repository including refs that point at non-commit object' '
+       test_when_finished "git reset --hard original" &&
+       tree=$(git rev-parse HEAD^{tree}) &&
+       test_when_finished "git replace -d $tree" &&
+       echo A >new &&
+       git add new &&
+       new_tree=$(git write-tree) &&
+       git replace $tree $new_tree &&
+       git tag -a -m "tag to a tree" treetag $new_tree &&
+       git reset --hard HEAD &&
+       git filter-branch -f -- --all >filter-output 2>&1 &&
+       ! fgrep fatal filter-output
+'
+
 test_done