mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-18 21:28:02 +00:00
fix ./scripts/env for newer git versions
SVN-Revision: 12502
This commit is contained in:
parent
081d16fed0
commit
973d7e80d7
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user