From: Elia Pinto <gitter.spiros@gmail.com>
To: git@vger.kernel.org
Cc: Elia Pinto <gitter.spiros@gmail.com>
Subject: [PATCH] git-remote-testgit.sh: cleaned up the logic for setting the refspec variable
Date: Fri, 23 May 2014 09:17:42 -0700 [thread overview]
Message-ID: <1400861862-6963-1-git-send-email-gitter.spiros@gmail.com> (raw)
This patch makes the code more readable for setting
the refspec variable
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
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
reply other threads:[~2014-05-23 16:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400861862-6963-1-git-send-email-gitter.spiros@gmail.com \
--to=gitter.spiros@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).