1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-24 04:48:57 +02:00

fix ./scripts/env for newer git versions

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12502 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2008-09-02 15:48:40 +00:00
parent 68c0a1f6b8
commit 5e0e6f254e

View File

@ -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
}