Skip to content

Commit

Permalink
reset
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMcCulloh committed Aug 29, 2023
1 parent 7c0bdd6 commit 25a2eda
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/bump-pack/src/derive-shas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ async function findSuccessfulCommit(branchName: string) {
try {
// create a new branch locally to rebase onto main
const tmpBranchName = `tmp-pr-diff-${HEAD_SHA}`;

try {
betterExec(`git branch -D --force ${tmpBranchName}`);
} catch {}
Expand Down Expand Up @@ -99,7 +100,8 @@ async function findSuccessfulCommit(branchName: string) {
betterExec(`git rebase --quit`);
} catch {}

betterExec(`git switch ${originalHEAD_SHA}`);
// regardless of whether we succeeded or not, switch back to the original commit
betterExec(`git reset --hard ${originalHEAD_SHA}`);
}
}

Expand Down

0 comments on commit 25a2eda

Please sign in to comment.