Skip to content

Commit

Permalink
Support offline mode for start-work
Browse files Browse the repository at this point in the history
Sometimes the remote repo can be unavailable when a new work starts.
That's why the execution of `start-work` should be continued regardless
of `git pull` execution status.
  • Loading branch information
extsoft committed Mar 12, 2020
1 parent 9e2acc0 commit e8948fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libexec/git-elegant-start-work
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ MESSAGE
local target=${2:-${MASTER}}
git-verbose checkout ${target}
if is-there-upstream-for ${target}; then
git-verbose pull
git-verbose pull || info-text "As the pull can't be completed, the current local version is used."
fi
git-verbose checkout -b "$1"
}
Expand Down
3 changes: 2 additions & 1 deletion tests/git-elegant-start-work.bats
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ teardown() {
fake-fail "git pull"
fake-pass "git rev-parse --abbrev-ref master@{upstream}"
check git-elegant start-work test-feature
[[ ${status} -eq 100 ]]
[[ ${status} -eq 0 ]]
[[ ${lines[@]} =~ "As the pull can't be completed, the current local version is used." ]]
}

@test "'start-work': raises 45 error if work name is not set" {
Expand Down

0 comments on commit e8948fa

Please sign in to comment.