Skip to content

Commit f74949f

Browse files
pks-tttaylorr
authored andcommitted
t3404: work around platform-specific behaviour on macOS 10.15
Two of our tests in t3404 use indented HERE docs where leading tabs on some of the lines are actually relevant. The tabs do get removed though, and we try to fix this up by using sed(1) to replace leading tabs in the actual output, as well. But macOS 10.15 uses an oldish version of sed(1) that has BSD lineage, which does not understand "\t", and thus we fail to strip those leading tabs and fail the test. Address this issue by using `q_to_tab` such that we do not have to strip leading tabs from the actual output. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 3acb1f7 commit f74949f

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

t/t3404-rebase-interactive.sh

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,18 +1917,17 @@ test_expect_success '--update-refs updates refs correctly' '
19171917
test_cmp_rev HEAD~1 refs/heads/third &&
19181918
test_cmp_rev HEAD refs/heads/no-conflict-branch &&
19191919
1920-
cat >expect <<-\EOF &&
1920+
q_to_tab >expect <<-\EOF &&
19211921
Successfully rebased and updated refs/heads/update-refs.
19221922
Updated the following refs with --update-refs:
1923-
refs/heads/first
1924-
refs/heads/no-conflict-branch
1925-
refs/heads/second
1926-
refs/heads/third
1923+
Qrefs/heads/first
1924+
Qrefs/heads/no-conflict-branch
1925+
Qrefs/heads/second
1926+
Qrefs/heads/third
19271927
EOF
19281928
19291929
# Clear "Rebasing (X/Y)" progress lines and drop leading tabs.
1930-
sed -e "s/Rebasing.*Successfully/Successfully/g" -e "s/^\t//g" \
1931-
<err >err.trimmed &&
1930+
sed "s/Rebasing.*Successfully/Successfully/g" <err >err.trimmed &&
19321931
test_cmp expect err.trimmed
19331932
'
19341933

@@ -2178,19 +2177,18 @@ test_expect_success '--update-refs: check failed ref update' '
21782177
test_must_fail git rebase --continue 2>err &&
21792178
grep "update_ref failed for ref '\''refs/heads/second'\''" err &&
21802179
2181-
cat >expect <<-\EOF &&
2180+
q_to_tab >expect <<-\EOF &&
21822181
Updated the following refs with --update-refs:
2183-
refs/heads/first
2184-
refs/heads/no-conflict-branch
2185-
refs/heads/third
2182+
Qrefs/heads/first
2183+
Qrefs/heads/no-conflict-branch
2184+
Qrefs/heads/third
21862185
Failed to update the following refs with --update-refs:
2187-
refs/heads/second
2186+
Qrefs/heads/second
21882187
EOF
21892188
21902189
# Clear "Rebasing (X/Y)" progress lines and drop leading tabs.
21912190
tail -n 6 err >err.last &&
2192-
sed -e "s/Rebasing.*Successfully/Successfully/g" -e "s/^\t//g" \
2193-
<err.last >err.trimmed &&
2191+
sed "s/Rebasing.*Successfully/Successfully/g" <err.last >err.trimmed &&
21942192
test_cmp expect err.trimmed
21952193
'
21962194

0 commit comments

Comments
 (0)