Stash unstaged changes to support patching
This commit is contained in:
parent
d129b740e6
commit
e382a52cf1
1 changed files with 5 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
STASH_NAME="pre-commit-$(date %d-%m-%Y-%H-%M-%S)"
|
||||||
|
|
||||||
# Check if the directory is the root directory
|
# Check if the directory is the root directory
|
||||||
if [ ! -d ".git/" ]; then
|
if [ ! -d ".git/" ]; then
|
||||||
|
|
@ -6,8 +7,12 @@ if [ ! -d ".git/" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
git stash push --quiet --keep-index --message $STASH_NAME
|
||||||
|
|
||||||
# Run every file inside the pre-commit.d directory
|
# Run every file inside the pre-commit.d directory
|
||||||
for file in .git/hooks/pre-commit.d/*
|
for file in .git/hooks/pre-commit.d/*
|
||||||
do
|
do
|
||||||
. $file
|
. $file
|
||||||
done
|
done
|
||||||
|
|
||||||
|
git stash pop --quiet
|
||||||
|
|
|
||||||
Reference in a new issue