Skip to content

Commit 8890b4f

Browse files
committed
Merge branch 'mt/openindiana-portability'
Portability updates to various uses of grep and sed. * mt/openindiana-portability: t/t9001-send-email.sh: sed - remove the i flag for s t/t9118-git-svn-funky-branch-names.sh: sed needs semicolon t/t1700-split-index.sh: mv -v is not portable t/t4202-log.sh: fix misspelled variable t/t0600-reffiles-backend.sh: rm -v is not portable t/t9902-completion.sh: backslashes in echo Switch grep from non-portable BRE to portable ERE
2 parents d365a27 + bac28a9 commit 8890b4f

8 files changed

+8
-8
lines changed

mergetools/vimdiff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ gen_cmd () {
325325
fi
326326

327327
# If this is a single window diff with all the buffers
328-
if ! echo "$tab" | grep ",\|/" >/dev/null
328+
if ! echo "$tab" | grep -E ",|/" >/dev/null
329329
then
330330
CMD="$CMD | silent execute 'bufdo diffthis'"
331331
fi

t/t0600-reffiles-backend.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ test_expect_success SYMLINKS 'git branch -m with symlinked .git/refs' '
424424
test_when_finished "rm -rf subdir" &&
425425
git init --bare subdir &&
426426
427-
rm -rfv subdir/refs subdir/objects subdir/packed-refs &&
427+
rm -rf subdir/refs subdir/objects subdir/packed-refs &&
428428
ln -s ../.git/refs subdir/refs &&
429429
ln -s ../.git/objects subdir/objects &&
430430
ln -s ../.git/packed-refs subdir/packed-refs &&

t/t1404-update-ref-errors.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ df_test() {
100100
printf "%s\n" "delete $delname" "create $addname $D"
101101
fi >commands &&
102102
test_must_fail git update-ref --stdin <commands 2>output.err &&
103-
grep "fatal:\( cannot lock ref $SQ$addname$SQ:\)\? $SQ$delref$SQ exists; cannot create $SQ$addref$SQ" output.err &&
103+
grep -E "fatal:( cannot lock ref $SQ$addname$SQ:)? $SQ$delref$SQ exists; cannot create $SQ$addref$SQ" output.err &&
104104
printf "%s\n" "$C $delref" >expected-refs &&
105105
git for-each-ref --format="%(objectname) %(refname)" $prefix/r >actual-refs &&
106106
test_cmp expected-refs actual-refs

t/t1700-split-index.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ test_expect_success 'reading split index at alternate location' '
527527
528528
# ... and, for backwards compatibility, in the current GIT_DIR
529529
# as well.
530-
mv -v ./reading-alternate-location/.git/sharedindex.* .git &&
530+
mv ./reading-alternate-location/.git/sharedindex.* .git &&
531531
GIT_INDEX_FILE=./reading-alternate-location/.git/index \
532532
git ls-files --cached >actual &&
533533
test_cmp expect actual

t/t4202-log.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2022,7 +2022,7 @@ test_expect_success GPGSM 'log --graph --show-signature x509' '
20222022
test_expect_success GPGSSH 'log --graph --show-signature ssh' '
20232023
test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
20242024
git log --graph --show-signature -n1 signed-ssh >actual &&
2025-
grep "${GOOD_SIGNATURE_TRUSTED}" actual
2025+
grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual
20262026
'
20272027

20282028
test_expect_success GPGSSH,GPGSSH_VERIFYTIME 'log shows failure on expired signature key' '

t/t9001-send-email.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,7 @@ test_expect_success $PREREQ 'test forbidSendmailVariables behavior override' '
25262526

25272527
test_expect_success $PREREQ '--compose handles lowercase headers' '
25282528
write_script fake-editor <<-\EOF &&
2529-
sed "s/^From:.*/from: [email protected]/i" "$1" >"$1.tmp" &&
2529+
sed "s/^[Ff][Rr][Oo][Mm]:.*/from: [email protected]/" "$1" >"$1.tmp" &&
25302530
mv "$1.tmp" "$1"
25312531
EOF
25322532
clean_fake_sendmail &&

t/t9118-git-svn-funky-branch-names.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test_expect_success 'setup svnrepo' '
3838
# SVN 1.7 will truncate "not-a%40{0]" to just "not-a".
3939
# Look at what SVN wound up naming the branch and use that.
4040
# Be sure to escape the @ if it shows up.
41-
non_reflog=$(svn_cmd ls "$svnrepo/pr ject/branches" | sed -ne '/not-a/ { s/\///; s/@/%40/; p }')
41+
non_reflog=$(svn_cmd ls "$svnrepo/pr ject/branches" | sed -ne '/not-a/ { s/\///; s/@/%40/; p; }')
4242

4343
test_expect_success 'test clone with funky branch names' '
4444
git svn clone -s "$svnrepo/pr ject" project &&

t/t9902-completion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ _get_comp_words_by_ref ()
7373
print_comp ()
7474
{
7575
local IFS=$'\n'
76-
echo "${COMPREPLY[*]}" > out
76+
printf '%s\n' "${COMPREPLY[*]}" > out
7777
}
7878

7979
run_completion ()

0 commit comments

Comments
 (0)