Skip to content

Commit

Permalink
Restore test, define test prereq
Browse files Browse the repository at this point in the history
  • Loading branch information
newren committed Jul 7, 2024
1 parent 68f433d commit 5290b0c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions t/t9391-filter-repo-lib-usage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,44 @@ test_expect_success 'lint-history' '
)
'

test_expect_success !WINDOWS 'lint-history --refs' '
test_create_repo lint-history-only-some-refs &&
(
cd lint-history-only-some-refs &&
test_commit a somefile bad &&
test_commit b notherfile baaad &&
test_commit c whatever baaaaaad &&
git checkout -b mybranch HEAD~1 &&
test_commit d somefile baaaaaaaad &&
test_commit e whatever "baaaaaaaaaad to the bone" &&
cat <<-EOF >linter.sh &&
#!/bin/bash
cat \$1 | tr -d a >tmp
mv tmp \$1
EOF
chmod u+x linter.sh &&
PATH=$PATH:. $CONTRIB_DIR/lint-history --refs master..mybranch -- linter.sh &&
echo bd >expect &&
echo bd to the bone >long-expect &&
# Verify master is untouched
git checkout master &&
! test_cmp somefile expect &&
! test_cmp notherfile expect &&
! test_cmp whatever expect &&
# Verify that files touched on the branch are tweaked
git checkout mybranch &&
test_cmp somefile expect &&
! test_cmp notherfile expect &&
test_cmp whatever long-expect
)
'

test_expect_success 'clean-ignore with emoji in filenames' '
test_create_repo clean-ignore &&
(
Expand Down

0 comments on commit 5290b0c

Please sign in to comment.