Merge branch 'cc/perf-aggregate-sort'
[gitweb.git] / t / t7003-filter-branch.sh
index 7cb60799be1a109e2210350137c8754a5bc4bb7d..04f79f32b4b8a23f2b34577e9f7e1a154963da6a 100755 (executable)
@@ -470,4 +470,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