aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-09-02 15:48:40 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-09-02 15:48:40 +0000
commitefaf2611622714cdc1d5c2323fd23edd3b7f90df (patch)
tree175b79ef5d6e77fa852c9dd0256baeed3d139c45
parent0fb2200b5e965b4652262c5f58911937b78b470f (diff)
downloadupstream-efaf2611622714cdc1d5c2323fd23edd3b7f90df.tar.gz
upstream-efaf2611622714cdc1d5c2323fd23edd3b7f90df.tar.bz2
upstream-efaf2611622714cdc1d5c2323fd23edd3b7f90df.zip
fix ./scripts/env for newer git versions
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12502 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-xscripts/env4
1 files changed, 1 insertions, 3 deletions
diff --git a/scripts/env b/scripts/env
index 1aee4b323b..e08869596d 100755
--- a/scripts/env
+++ b/scripts/env
@@ -150,7 +150,6 @@ env_delete() {
local name="${1##*/}"
env_init
[ -z "$name" ] && usage
- [ -f "$ENVDIR/.git/refs/heads/$name" ] || error "environment '$name' not found"
branch="$(git branch | grep '^\* ' | awk '{print $2}')"
[ "$name" = "$branch" ] && error "cannot delete the currently selected environment"
git branch -D "$name"
@@ -159,11 +158,10 @@ env_delete() {
env_switch() {
local name="${1##*/}"
[ -z "$name" ] && usage
- [ -f "$ENVDIR/.git/refs/heads/$name" ] || error "environment '$name' not found"
env_init
env_ask_sync
- git checkout "$name"
+ git checkout "$name" || error "environment '$name' not found"
env_link_config
}