Skip to content

Commit 081081d

Browse files
DDvOt8m
authored andcommitted
pick_to_branch: tweak 'git checkout' calls
Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from #228)
1 parent 4dec867 commit 081081d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

review-tools/pick-to-branch

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function cleanup {
111111
fi
112112
if [ "$TARGET" != "$ORIG_REF" ]; then
113113
echo Returning to previous branch $ORIG_REF
114-
git checkout -q $ORIG_REF
114+
git checkout --force --quiet $ORIG_REF
115115
if [ "$STASH_OUT" != "No local changes to save" ]; then
116116
git stash pop -q # restore original state, pruning any leftover commits added locally
117117
fi
@@ -120,8 +120,7 @@ function cleanup {
120120
set -o errexit
121121
trap 'cleanup' EXIT
122122

123-
git checkout --quiet master
124-
git checkout $TARGET
123+
git checkout --force $TARGET
125124
ORIG_TARGET_HEAD=`git show -s --format="%H"`
126125
git pull --ff-only `git rev-parse --abbrev-ref @{u} | sed "s|/| |"`
127126
CHERRYPICKING=1

0 commit comments

Comments
 (0)