Add a check for being a git repo

master
Semisol 2021-08-17 12:52:14 +03:00
parent fbfd49afb4
commit 7e341e3b1f
Signed by: Semisol
GPG Key ID: D1C04206D89306D5
1 changed files with 6 additions and 0 deletions

View File

@ -7,6 +7,12 @@ then
echo " git force <remote> <branch>"
exit 0
fi
git rev-parse --is-inside-work-tree > /dev/null 2>&1
if [[ "$?" != "0" ]]
then
echo "error: not a git repository"
exit 10
fi
REMOTE=""
BRANCH=""
PRETTY="--pretty=format:%h, %an <%ae>, %cr: %s"