Skip to content

Commit

Permalink
Make --force removal for local WORK_BRANCH
Browse files Browse the repository at this point in the history
`--delete` doesn't guarantee removing of WORK_BRANCH if a rebase is
applied. It's happens since remote branch has other history then local
one. That's why, if a rebase is done, it's safe to remove local branch
with `--force` option.
  • Loading branch information
extsoft committed Jul 29, 2019
1 parent 1ce6967 commit 8893d89
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ git rebase origin/master
git checkout master
git merge --ff-only __eg
git push origin master:master
git branch -d __eg
git branch --delete --force __eg
git push origin --delete <remote-branch-name>
```

Expand Down
2 changes: 1 addition & 1 deletion libexec/git-elegant-accept-work
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ default() {
boxtee git checkout ${MASTER}
boxtee git merge --ff-only ${WORK_BRANCH}
boxtee git push ${REMOTE_NAME} ${MASTER}:${MASTER}
boxtee git branch --delete ${WORK_BRANCH}
boxtee git branch --delete --force ${WORK_BRANCH}
boxtee git push ${REMOTE_NAME} --delete $(echo "${1}" | sed -e "s|${REMOTE_NAME}/||")
}
2 changes: 1 addition & 1 deletion tests/git-elegant-accept-work.bats
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ teardown() {
fake-pass git "checkout master"
fake-pass git "merge --ff-only __eg"
fake-pass git "push origin master:master"
fake-pass git "branch --delete __eg"
fake-pass git "branch --delete --force __eg"
fake-pass git "push origin --delete work"
check git-elegant accept-work origin/work
[[ "$status" -eq 0 ]]
Expand Down

0 comments on commit 8893d89

Please sign in to comment.