Skip to content

Commit 5288297

Browse files
committed
add comment
1 parent a3b4442 commit 5288297

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/promote_release.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,12 @@ export default class ReleasePromotion extends Session {
150150
const appliedCleanly = await this.cherryPickToDefaultBranch();
151151

152152
// Ensure `node_version.h`'s `NODE_VERSION_IS_RELEASE` bit is not updated
153-
await forceRunAsync('git',
154-
['checkout', appliedCleanly ? 'HEAD^' : 'HEAD', '--', 'src/node_version.h'],
155-
{ ignoreFailure: false });
153+
await forceRunAsync('git', ['checkout',
154+
appliedCleanly
155+
? 'HEAD^' // In the absence of conflict, the top of the remote branch is the commit before.
156+
: 'HEAD', // In case of conflict, HEAD is still the top of the remove branch.
157+
'--', 'src/node_version.h'],
158+
{ ignoreFailure: false });
156159

157160
if (appliedCleanly) {
158161
// There were no conflicts, we have to amend the commit to revert the

0 commit comments

Comments
 (0)