1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

rmport: first check if we are in a git checkout, then check for changes.

This commit is contained in:
Rene Ladan 2021-09-08 21:57:45 +02:00
parent b962cadeb2
commit 332b174080

View File

@ -352,10 +352,6 @@ usage()
# main
if ! ${GIT} diff --exit-code remotes/origin/main ; then
echo "you have local commits, exiting" >&2
exit 65
fi
if [ ! -r ${INDEX} ] ; then
echo "${INDEX} not readable, exiting" >&2
exit 66
@ -369,6 +365,10 @@ if [ ${exitcode} -ne 0 ] ; then
else
cd "${git_dir}/.." || exit 1
fi
if ! ${GIT} diff --exit-code remotes/origin/main ; then
echo "you have local commits, exiting" >&2
exit 65
fi
if [ ${#} -eq 0 ] || [ "${1}" = "-h" ] || [ "${1}" = "--help" ] ; then
usage