]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t0021: test filter metadata for additional cases
authorbrian m. carlson <bk2204@github.com>
Mon, 16 Mar 2020 18:05:08 +0000 (18:05 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Mar 2020 18:37:02 +0000 (11:37 -0700)
Check that we get the expected data when performing a merges or
generating archives.  Note that we don't expect a ref for merges,
because we won't be checking out any particular ref, but instead a tree
of the merged data.  For archives, however, we expect a ref as normal if
we have one.

Signed-off-by: brian m. carlson <bk2204@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0021-conversion.sh

index a026fd46b4ee369b550d970fd545baa8ea69021e..4bfffa9c314bf8236c9c7d74fca166ed86d5952a 100755 (executable)
@@ -488,6 +488,51 @@ test_expect_success PERL 'required process filter should filter data for various
                        IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $META blob=$M3 $S3 [OK] -- OUT: $S3 . [OK]
                        STOP
                EOF
+               test_cmp_exclude_clean expected.log debug.log &&
+
+               git checkout -b merge empty-branch &&
+               git branch -f master $MASTER2 &&
+               filter_git merge master &&
+               META="treeish=$MASTER2" &&
+               cat >expected.log <<-EOF &&
+                       START
+                       init handshake complete
+                       IN: smudge test.r $META blob=$M $S [OK] -- OUT: $S . [OK]
+                       IN: smudge test2.r $META blob=$M2 $S2 [OK] -- OUT: $S2 . [OK]
+                       IN: smudge test4-empty.r $META blob=$EMPTY 0 [OK] -- OUT: 0  [OK]
+                       IN: smudge test5.r $META blob=$M $S [OK] -- OUT: $S . [OK]
+                       IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $META blob=$M3 $S3 [OK] -- OUT: $S3 . [OK]
+                       STOP
+               EOF
+               test_cmp_exclude_clean expected.log debug.log &&
+
+               filter_git archive master >/dev/null &&
+               META="ref=refs/heads/master treeish=$MASTER2" &&
+               cat >expected.log <<-EOF &&
+                       START
+                       init handshake complete
+                       IN: smudge test.r $META blob=$M $S [OK] -- OUT: $S . [OK]
+                       IN: smudge test2.r $META blob=$M2 $S2 [OK] -- OUT: $S2 . [OK]
+                       IN: smudge test4-empty.r $META blob=$EMPTY 0 [OK] -- OUT: 0  [OK]
+                       IN: smudge test5.r $META blob=$M $S [OK] -- OUT: $S . [OK]
+                       IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $META blob=$M3 $S3 [OK] -- OUT: $S3 . [OK]
+                       STOP
+               EOF
+               test_cmp_exclude_clean expected.log debug.log &&
+
+               TREE="$(git rev-parse $MASTER2^{tree})" &&
+               filter_git archive $TREE >/dev/null &&
+               META="treeish=$TREE" &&
+               cat >expected.log <<-EOF &&
+                       START
+                       init handshake complete
+                       IN: smudge test.r $META blob=$M $S [OK] -- OUT: $S . [OK]
+                       IN: smudge test2.r $META blob=$M2 $S2 [OK] -- OUT: $S2 . [OK]
+                       IN: smudge test4-empty.r $META blob=$EMPTY 0 [OK] -- OUT: 0  [OK]
+                       IN: smudge test5.r $META blob=$M $S [OK] -- OUT: $S . [OK]
+                       IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $META blob=$M3 $S3 [OK] -- OUT: $S3 . [OK]
+                       STOP
+               EOF
                test_cmp_exclude_clean expected.log debug.log
        )
 '