* [PATCH] compat-wireless: fix fallbacks for unknown branch, remote or remote URL
@ 2010-04-07 22:08 Pavel Roskin
2010-04-07 22:11 ` Luis R. Rodriguez
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Roskin @ 2010-04-07 22:08 UTC (permalink / raw)
To: Luis R. Rodriguez, linux-wireless
Use bash syntax that yields the replacement value if the variable is
either empty or unset. The original code would only check for unset
variables, but the variable would be set even if git failed to give any
output to stdout.
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
scripts/admin-update.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 5d8068d..36cdfac 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -296,11 +296,11 @@ DIR="$PWD"
cd $GIT_TREE
GIT_DESCRIBE=$(git describe)
GIT_BRANCH=$(git branch --no-color |sed -n 's/^\* //p')
-GIT_BRANCH=${GIT_BRANCH-master}
+GIT_BRANCH=${GIT_BRANCH:-master}
GIT_REMOTE=$(git config branch.${GIT_BRANCH}.remote)
-GIT_REMOTE=${GIT_REMOTE-origin}
+GIT_REMOTE=${GIT_REMOTE:-origin}
GIT_REMOTE_URL=$(git config remote.${GIT_REMOTE}.url)
-GIT_REMOTE_URL=${GIT_REMOTE_URL-unknown}
+GIT_REMOTE_URL=${GIT_REMOTE_URL:-unknown}
echo -e "${GREEN}Updated${NORMAL} from local tree: ${BLUE}${GIT_TREE}${NORMAL}"
echo -e "Origin remote URL: ${CYAN}${GIT_REMOTE_URL}${NORMAL}"
cd $DIR
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] compat-wireless: fix fallbacks for unknown branch, remote or remote URL
2010-04-07 22:08 [PATCH] compat-wireless: fix fallbacks for unknown branch, remote or remote URL Pavel Roskin
@ 2010-04-07 22:11 ` Luis R. Rodriguez
0 siblings, 0 replies; 2+ messages in thread
From: Luis R. Rodriguez @ 2010-04-07 22:11 UTC (permalink / raw)
To: Pavel Roskin; +Cc: linux-wireless
On Wed, Apr 7, 2010 at 3:08 PM, Pavel Roskin <proski@gnu.org> wrote:
> Use bash syntax that yields the replacement value if the variable is
> either empty or unset. The original code would only check for unset
> variables, but the variable would be set even if git failed to give any
> output to stdout.
thanks applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-07 22:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-07 22:08 [PATCH] compat-wireless: fix fallbacks for unknown branch, remote or remote URL Pavel Roskin
2010-04-07 22:11 ` Luis R. Rodriguez
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).