git-remote-testgit: further remove some bashisms
authorJohannes Sixt <j.sixt@viscovery.net>
Thu, 25 Apr 2013 10:59:41 +0000 (12:59 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 28 Apr 2013 22:20:24 +0000 (15:20 -0700)
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
git-remote-testgit
index 643e4aeb1901b29afe092f26af4b8b5f147a7ea2..b5289493e2ca84bbbff58734bcb0abcae2145312 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
 # Copyright (c) 2012 Felipe Contreras
 
 alias=$1
@@ -23,7 +23,6 @@ then
        testgitmarks="$dir/testgit.marks"
        test -e "$gitmarks" || >"$gitmarks"
        test -e "$testgitmarks" || >"$testgitmarks"
-       testgitmarks_args=( "--"{import,export}"-marks=$testgitmarks" )
 fi
 
 while read line
@@ -69,7 +68,10 @@ do
                fi
 
                echo "feature done"
-               git fast-export "${testgitmarks_args[@]}" $refs |
+               git fast-export \
+                       ${testgitmarks:+"--import-marks=$testgitmarks"} \
+                       ${testgitmarks:+"--export-marks=$testgitmarks"} \
+                       $refs |
                sed -e "s#refs/heads/#${prefix}/heads/#g"
                echo "done"
                ;;
@@ -88,7 +90,10 @@ do
 
                before=$(git for-each-ref --format=' %(refname) %(objectname) ')
 
-               git fast-import "${testgitmarks_args[@]}" --quiet
+               git fast-import \
+                       ${testgitmarks:+"--import-marks=$testgitmarks"} \
+                       ${testgitmarks:+"--export-marks=$testgitmarks"} \
+                       --quiet
 
                # figure out which refs were updated
                git for-each-ref --format='%(refname) %(objectname)' |