Skip to content

Commit c65a288

Browse files
committed
Merge branch 'ab/bsd-fixes'
Test portability fix. * ab/bsd-fixes: commit-graph tests: fix unportable "dd" invocation tests: fix unportable "\?" and "\+" regex syntax
2 parents 60a3fbf + b9cc405 commit c65a288

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

t/t5318-commit-graph.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ corrupt_graph_and_verify() {
382382
test_when_finished mv commit-graph-backup $objdir/info/commit-graph &&
383383
cp $objdir/info/commit-graph commit-graph-backup &&
384384
printf "$data" | dd of="$objdir/info/commit-graph" bs=1 seek="$pos" conv=notrunc &&
385-
dd of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" count=0 &&
385+
dd of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" if=/dev/null &&
386386
generate_zero_bytes $(($orig_size - $zero_pos)) >>"$objdir/info/commit-graph" &&
387387
test_must_fail git commit-graph verify 2>test_err &&
388388
grep -v "^+" test_err >err &&

t/t6120-describe.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ check_describe A-* HEAD
146146
test_expect_success 'describe works from outside repo using --git-dir' '
147147
git clone --bare "$TRASH_DIRECTORY" "$TRASH_DIRECTORY/bare" &&
148148
git --git-dir "$TRASH_DIRECTORY/bare" describe >out &&
149-
grep "^A-[1-9][0-9]\?-g[0-9a-f]\+$" out
149+
grep -E "^A-[1-9][0-9]?-g[0-9a-f]+$" out
150150
'
151151

152152
check_describe "A-*[0-9a-f]" --dirty
@@ -156,7 +156,7 @@ test_expect_success 'describe --dirty with --work-tree' '
156156
cd "$TEST_DIRECTORY" &&
157157
git --git-dir "$TRASH_DIRECTORY/.git" --work-tree "$TRASH_DIRECTORY" describe --dirty >"$TRASH_DIRECTORY/out"
158158
) &&
159-
grep "^A-[1-9][0-9]\?-g[0-9a-f]\+$" out
159+
grep -E "^A-[1-9][0-9]?-g[0-9a-f]+$" out
160160
'
161161

162162
test_expect_success 'set-up dirty work tree' '
@@ -170,7 +170,7 @@ test_expect_success 'describe --dirty with --work-tree (dirty)' '
170170
cd "$TEST_DIRECTORY" &&
171171
git --git-dir "$TRASH_DIRECTORY/.git" --work-tree "$TRASH_DIRECTORY" describe --dirty >"$TRASH_DIRECTORY/out"
172172
) &&
173-
grep "^A-[1-9][0-9]\?-g[0-9a-f]\+-dirty$" out
173+
grep -E "^A-[1-9][0-9]?-g[0-9a-f]+-dirty$" out
174174
'
175175

176176
check_describe "A-*[0-9a-f].mod" --dirty=.mod
@@ -180,7 +180,7 @@ test_expect_success 'describe --dirty=.mod with --work-tree (dirty)' '
180180
cd "$TEST_DIRECTORY" &&
181181
git --git-dir "$TRASH_DIRECTORY/.git" --work-tree "$TRASH_DIRECTORY" describe --dirty=.mod >"$TRASH_DIRECTORY/out"
182182
) &&
183-
grep "^A-[1-9][0-9]\?-g[0-9a-f]\+.mod$" out
183+
grep -E "^A-[1-9][0-9]?-g[0-9a-f]+.mod$" out
184184
'
185185

186186
test_expect_success 'describe --dirty HEAD' '

0 commit comments

Comments
 (0)