Skip to content

Commit

Permalink
Don't use obtain-work in clear-local
Browse files Browse the repository at this point in the history
`obtain-work` is replaced with `git checkout` command to switch a branch
before making a cleanup.
  • Loading branch information
extsoft committed Sep 14, 2019
1 parent deba86c commit ec89d0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libexec/git-elegant-clear-local
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ MESSAGE
}

default() {
git elegant obtain-work ${MASTER}
git-verbose checkout ${MASTER}
local cmd="git branch -lvv | grep gone | awk {'print \$1'}"
__loop "git branch -d" $(eval "$cmd") || \
(
Expand Down
10 changes: 6 additions & 4 deletions tests/git-elegant-clear-local.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
load addons-common
load addons-read
load addons-fake
load addons-git

setup() {
init-repo
gitrepo git branch --force first
fake-pass git "branch -lvv" "first [gone]"
fake-pass git "elegant obtain-work master"
fake-pass git "branch -d first"
}

teardown() {
clean-fake
clean-git
}

@test "'clear-local': command is available" {
check git-elegant clear-local
[ "$status" -eq 0 ]
check git-elegant clear-local
[[ "${status}" -eq 0 ]]
}

0 comments on commit ec89d0e

Please sign in to comment.