Skip to content

Commit 5290b0c

Browse files
committed
Restore test, define test prereq
1 parent 68f433d commit 5290b0c

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

t/t9391-filter-repo-lib-usage.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,44 @@ test_expect_success 'lint-history' '
205205
)
206206
'
207207

208+
test_expect_success !WINDOWS 'lint-history --refs' '
209+
test_create_repo lint-history-only-some-refs &&
210+
(
211+
cd lint-history-only-some-refs &&
212+
test_commit a somefile bad &&
213+
test_commit b notherfile baaad &&
214+
test_commit c whatever baaaaaad &&
215+
git checkout -b mybranch HEAD~1 &&
216+
test_commit d somefile baaaaaaaad &&
217+
test_commit e whatever "baaaaaaaaaad to the bone" &&
218+
219+
cat <<-EOF >linter.sh &&
220+
#!/bin/bash
221+
cat \$1 | tr -d a >tmp
222+
mv tmp \$1
223+
EOF
224+
chmod u+x linter.sh &&
225+
226+
PATH=$PATH:. $CONTRIB_DIR/lint-history --refs master..mybranch -- linter.sh &&
227+
228+
echo bd >expect &&
229+
echo bd to the bone >long-expect &&
230+
231+
# Verify master is untouched
232+
git checkout master &&
233+
! test_cmp somefile expect &&
234+
! test_cmp notherfile expect &&
235+
! test_cmp whatever expect &&
236+
237+
# Verify that files touched on the branch are tweaked
238+
git checkout mybranch &&
239+
test_cmp somefile expect &&
240+
! test_cmp notherfile expect &&
241+
test_cmp whatever long-expect
242+
243+
)
244+
'
245+
208246
test_expect_success 'clean-ignore with emoji in filenames' '
209247
test_create_repo clean-ignore &&
210248
(

0 commit comments

Comments
 (0)