forked from jan-leila/nix-config
feat: supported branching for commit checking
This commit is contained in:
parent
0c88746da1
commit
260e37e016
3 changed files with 100 additions and 9 deletions
18
.hooks/post-merge
Executable file
18
.hooks/post-merge
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash ../shell.nix
|
||||
|
||||
# Get current branch name
|
||||
current_branch=$(git branch --show-current)
|
||||
|
||||
# Only restore stash if we're on main branch and a merge just completed
|
||||
if [ "$current_branch" = "main" ]; then
|
||||
# Check if there are any stashes to restore
|
||||
if git stash list | grep -q "stash@"; then
|
||||
echo "Post-merge: restoring stashed changes on main branch"
|
||||
git stash pop -q
|
||||
else
|
||||
echo "Post-merge: no stash to restore on main branch"
|
||||
fi
|
||||
else
|
||||
echo "Post-merge: no action needed on branch '$current_branch'"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue