@matheusbsbs / matheus-bagliano / commits / 3b38ec16d5
Fork 0

rebase -i: exchange all "if [ .. ]" by "if test .."

This patch is literally :%s/if \[ *\(.*[^ ]\) *\]/if test \1/ in vi, after making sure that the other instances of "[..]" are not actually invocations of "test". Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Jul 24, 2007 at 03:18 UTC 3b38ec16d51a84bb5d4ef349f441de5f7ecd54f2
1 file changed +7 -7
git-rebase--interactive.sh
+7 -7
@@ -102,7 +102,7 @@ pick_one () {
102 pick_one_preserving_merges "$@" && return
103 parent_sha1=$(git rev-parse --verify $sha1^ 2>/dev/null)
104 current_sha1=$(git rev-parse --verify HEAD)
105 - if [ $current_sha1 = $parent_sha1 ]; then
105 + if test $current_sha1 = $parent_sha1; then
106 output git reset --hard $sha1
107 test "a$1" = a-n && output git reset --soft $current_sha1
108 sha1=$(git rev-parse --short $sha1)
@@ -116,7 +116,7 @@ pick_one_preserving_merges () {
116 case "$1" in -n) sha1=$2 ;; *) sha1=$1 ;; esac
117 sha1=$(git rev-parse $sha1)
118
119 - if [ -f "$DOTEST"/current-commit ]
119 + if test -f "$DOTEST"/current-commit
120 then
121 current_commit=$(cat "$DOTEST"/current-commit) &&
122 git rev-parse HEAD > "$REWRITTEN"/$current_commit &&
@@ -130,7 +130,7 @@ pick_one_preserving_merges () {
130 new_parents=
131 for p in $(git rev-list --parents -1 $sha1 | cut -d\ -f2-)
132 do
133 - if [ -f "$REWRITTEN"/$p ]
133 + if test -f "$REWRITTEN"/$p
134 then
135 preserve=f
136 new_p=$(cat "$REWRITTEN"/$p)
@@ -188,7 +188,7 @@ nth_string () {
188 }
189
190 make_squash_message () {
191 - if [ -f "$SQUASH_MSG" ]; then
191 + if test -f "$SQUASH_MSG"; then
192 COUNT=$(($(sed -n "s/^# This is [^0-9]*\([0-9]\+\).*/\1/p" \
193 < "$SQUASH_MSG" | tail -n 1)+1))
194 echo "# This is a combination of $COUNT commits."
@@ -286,7 +286,7 @@ do_next () {
286 HEADNAME=$(cat "$DOTEST"/head-name) &&
287 OLDHEAD=$(cat "$DOTEST"/head) &&
288 SHORTONTO=$(git rev-parse --short $(cat "$DOTEST"/onto)) &&
289 - if [ -d "$REWRITTEN" ]
289 + if test -d "$REWRITTEN"
290 then
291 test -f "$DOTEST"/current-commit &&
292 current_commit=$(cat "$DOTEST"/current-commit) &&
@@ -403,7 +403,7 @@ do
403
404 require_clean_work_tree
405
406 - if [ ! -z "$2"]
406 + if test ! -z "$2"
407 then
408 output git show-ref --verify --quiet "refs/heads/$2" ||
409 die "Invalid branchname: $2"
@@ -426,7 +426,7 @@ do
426 echo $ONTO > "$DOTEST"/onto
427 test -z "$STRATEGY" || echo "$STRATEGY" > "$DOTEST"/strategy
428 test t = "$VERBOSE" && : > "$DOTEST"/verbose
429 - if [ t = "$PRESERVE_MERGES" ]
429 + if test t = "$PRESERVE_MERGES"
430 then
431 # $REWRITTEN contains files for each commit that is
432 # reachable by at least one merge base of $HEAD and