Skip to content

Commit

Permalink
t9114-git-svn-dcommit-merge.sh: use the $( ... ) construct for comman…
Browse files Browse the repository at this point in the history
…d substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
	perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
devzero2000 authored and gitster committed Jan 12, 2016
1 parent efa639f commit 78ba28d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions t/t9114-git-svn-dcommit-merge.sh
Expand Up @@ -68,8 +68,8 @@ test_expect_success 'setup git mirror and merge' '
test_debug 'gitk --all & sleep 1'

test_expect_success 'verify pre-merge ancestry' "
test x\`git rev-parse --verify refs/heads/svn^2\` = \
x\`git rev-parse --verify refs/heads/merge\` &&
test x\$(git rev-parse --verify refs/heads/svn^2) = \
x\$(git rev-parse --verify refs/heads/merge) &&
git cat-file commit refs/heads/svn^ | grep '^friend$'
"

Expand All @@ -80,10 +80,10 @@ test_expect_success 'git svn dcommit merges' "
test_debug 'gitk --all & sleep 1'

test_expect_success 'verify post-merge ancestry' "
test x\`git rev-parse --verify refs/heads/svn\` = \
x\`git rev-parse --verify refs/remotes/origin/trunk \` &&
test x\`git rev-parse --verify refs/heads/svn^2\` = \
x\`git rev-parse --verify refs/heads/merge\` &&
test x\$(git rev-parse --verify refs/heads/svn) = \
x\$(git rev-parse --verify refs/remotes/origin/trunk) &&
test x\$(git rev-parse --verify refs/heads/svn^2) = \
x\$(git rev-parse --verify refs/heads/merge) &&
git cat-file commit refs/heads/svn^ | grep '^friend$'
"

Expand Down

0 comments on commit 78ba28d

Please sign in to comment.