Unverified Commit 1f957fde authored by boklm's avatar boklm
Browse files

Make ./tools/pull work when not on a branch

When we are not currently on a branch, ./tools/pull will now fetch
origin, and verify and checkout origin/master.
parent fa0773c0
......@@ -18,6 +18,16 @@ then
git reset master
fi
git config --replace-all --local gpg.program "$basedir/gpggit"
git pull --verify-signatures "$@"
if ! git symbolic-ref -q HEAD > /dev/null
then
# checkout origin/master if we are not on a branch
remote="${1:-origin}"
branch="${2:-master}"
git fetch "$remote"
git verify-commit "$remote/$branch"
git checkout "$remote/$branch"
else
git pull --verify-signatures "$@"
fi
git submodule init
git submodule update
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment