Skip to content

Commit 3b38ec1

Browse files
dschogitster
authored andcommitted
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>
1 parent dfa49f3 commit 3b38ec1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

git-rebase--interactive.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pick_one () {
102102
pick_one_preserving_merges "$@" && return
103103
parent_sha1=$(git rev-parse --verify $sha1^ 2>/dev/null)
104104
current_sha1=$(git rev-parse --verify HEAD)
105-
if [ $current_sha1 = $parent_sha1 ]; then
105+
if test $current_sha1 = $parent_sha1; then
106106
output git reset --hard $sha1
107107
test "a$1" = a-n && output git reset --soft $current_sha1
108108
sha1=$(git rev-parse --short $sha1)
@@ -116,7 +116,7 @@ pick_one_preserving_merges () {
116116
case "$1" in -n) sha1=$2 ;; *) sha1=$1 ;; esac
117117
sha1=$(git rev-parse $sha1)
118118

119-
if [ -f "$DOTEST"/current-commit ]
119+
if test -f "$DOTEST"/current-commit
120120
then
121121
current_commit=$(cat "$DOTEST"/current-commit) &&
122122
git rev-parse HEAD > "$REWRITTEN"/$current_commit &&
@@ -130,7 +130,7 @@ pick_one_preserving_merges () {
130130
new_parents=
131131
for p in $(git rev-list --parents -1 $sha1 | cut -d\ -f2-)
132132
do
133-
if [ -f "$REWRITTEN"/$p ]
133+
if test -f "$REWRITTEN"/$p
134134
then
135135
preserve=f
136136
new_p=$(cat "$REWRITTEN"/$p)
@@ -188,7 +188,7 @@ nth_string () {
188188
}
189189

190190
make_squash_message () {
191-
if [ -f "$SQUASH_MSG" ]; then
191+
if test -f "$SQUASH_MSG"; then
192192
COUNT=$(($(sed -n "s/^# This is [^0-9]*\([0-9]\+\).*/\1/p" \
193193
< "$SQUASH_MSG" | tail -n 1)+1))
194194
echo "# This is a combination of $COUNT commits."
@@ -286,7 +286,7 @@ do_next () {
286286
HEADNAME=$(cat "$DOTEST"/head-name) &&
287287
OLDHEAD=$(cat "$DOTEST"/head) &&
288288
SHORTONTO=$(git rev-parse --short $(cat "$DOTEST"/onto)) &&
289-
if [ -d "$REWRITTEN" ]
289+
if test -d "$REWRITTEN"
290290
then
291291
test -f "$DOTEST"/current-commit &&
292292
current_commit=$(cat "$DOTEST"/current-commit) &&
@@ -403,7 +403,7 @@ do
403403

404404
require_clean_work_tree
405405

406-
if [ ! -z "$2"]
406+
if test ! -z "$2"
407407
then
408408
output git show-ref --verify --quiet "refs/heads/$2" ||
409409
die "Invalid branchname: $2"
@@ -426,7 +426,7 @@ do
426426
echo $ONTO > "$DOTEST"/onto
427427
test -z "$STRATEGY" || echo "$STRATEGY" > "$DOTEST"/strategy
428428
test t = "$VERBOSE" && : > "$DOTEST"/verbose
429-
if [ t = "$PRESERVE_MERGES" ]
429+
if test t = "$PRESERVE_MERGES"
430430
then
431431
# $REWRITTEN contains files for each commit that is
432432
# reachable by at least one merge base of $HEAD and

0 commit comments

Comments
 (0)