Skip to content

Function: executeGitDiscardBranchHook() ​

ts
function executeGitDiscardBranchHook(
   _node, 
   input, 
   ctx
): Promise<void>;

Defined in: git/src/executors/git-hooks-and-checks.ts:178

Executes a GitDiscardBranchNode (git.resetWorktree() / git.discardBranch()) rewind hook on input.handle.

Restores input.handle to input.targetStepBaseScopeCheckpoint (or resets to handle.baseRef if absent).

Parameters ​

ParameterTypeDescription
_nodeGitDiscardBranchNodePassive discard-branch rewind hook AST node.
inputRewindHookExecutionInput<GitWorktreeHandle>Rewind hook execution input.
ctxStepExecutionContext<GitWorktreeHandle>Active step execution context.

Returns ​

Promise<void>

Resolves once the worktree is restored to the target step's base checkpoint.

Released under the MIT License.