Skip to content

Commit f678d85

Browse files
committed
execute post-stacked-rebase hook if exists
Signed-off-by: Kipras Melnikovas <[email protected]>
1 parent 12138ea commit f678d85

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

filenames.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const filenames = {
77
//
88
gitRebaseTodo: "git-rebase-todo",
99
//
10+
postStackedRebaseHook: "post-stacked-rebase",
1011

1112
/**
1213
* TODO extract others into here

git-stacked-rebase.ts

+9
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,15 @@ cat "$REWRITTEN_LIST_FILE_PATH" > "$REWRITTEN_LIST_BACKUP_FILE_PATH"
643643
}
644644
}
645645

646+
/**
647+
* execute the post-stacked-rebase hook if exists.
648+
* will only happen if the rebase went thru, and in our control.
649+
*/
650+
const postStackedRebaseHook: string = path.join(dotGitDirPath, "hooks", filenames.postStackedRebaseHook);
651+
if (fs.existsSync(postStackedRebaseHook)) {
652+
execSyncInRepo(postStackedRebaseHook);
653+
}
654+
646655
return;
647656
} catch (e) {
648657
throw e; // TODO FIXME - no try/catch at all?

0 commit comments

Comments
 (0)