From d9986a393cc3898805f195d4f6091b4badb25eed Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Wed, 15 May 2019 16:07:41 -0400 Subject: [PATCH] Improve `done` recipe (#444) The old version often failed due to rebase conflicts if the feature branch to delete had multiple commits and was squash-merged into master. This version just checks that the up-to-date master branch matches the feature branch and uses -D to delete the feature branch. This guarantees that we don't lose any work, and avoids bad rebases from squash merges to master. --- justfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index a22c6a7..bd74400 100755 --- a/justfile +++ b/justfile @@ -51,11 +51,11 @@ publish: publish-check # clean up feature branch BRANCH done BRANCH: - git checkout {{BRANCH}} - git pull --rebase github master git checkout master + git diff --no-ext-diff --quiet --exit-code git pull --rebase github master - git branch -d {{BRANCH}} + git diff --no-ext-diff --quiet --exit-code {{BRANCH}} + git branch -D {{BRANCH}} # install just from crates.io install: