[PATCH] git-remote-testgit.sh: cleaned up the logic for setting the refspec variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch makes the code more readable for setting
the refspec variable

Signed-off-by: Elia Pinto <gitter.spiros@xxxxxxxxx>
---
 git-remote-testgit.sh |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/git-remote-testgit.sh b/git-remote-testgit.sh
index 1c006a0..fb8a003 100755
--- a/git-remote-testgit.sh
+++ b/git-remote-testgit.sh
@@ -4,18 +4,20 @@
 alias=$1
 url=$2
 
+if test -z "${GIT_REMOTE_TESTGIT_REFSPEC-notEmpty}"
+then
+	# only if it is explicitly set to an empty string...
+	prefix=refs
+else
+	prefix="refs/testgit/$alias"
+fi
 dir="$GIT_DIR/testgit/$alias"
-prefix="refs/testgit/$alias"
-
 default_refspec="refs/heads/*:${prefix}/heads/*"
-
 refspec="${GIT_REMOTE_TESTGIT_REFSPEC-$default_refspec}"
-
-test -z "$refspec" && prefix="refs"
+force=
 
 export GIT_DIR="$url/.git"
 
-force=
 
 mkdir -p "$dir"
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]