Allow checkout after clone to fail

When $PORTZAP_BRANCH happens to be the default branch,
'git checkout' will exit with an error. Ignore.
This commit is contained in:
0x1eef 2024-04-20 01:55:41 -03:00
parent 1739b7d794
commit 94493d6040

View file

@ -32,13 +32,8 @@ echo "[-] Adjust filemode. This might take a while"
doas -u _portzap "${git}" config core.filemode off
doas -u root /bin/chmod -R ${mode} "${gitdir}"
echo "[-] git checkout ${branch}"
if ! doas -u _portzap "${git}" \
checkout -t \
origin/"${branch}" \
> /dev/null 2>&1; then
r="${?}"
echo "[-] 'git checkout' exited with an error"
exit "${r}"
else
echo "[-] Done"
fi
doas -u _portzap "${git}" \
checkout -t \
origin/"${branch}" \
> /dev/null 2>&1
echo "[-] Done"