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 _portzap "${git}" config core.filemode off
doas -u root /bin/chmod -R ${mode} "${gitdir}" doas -u root /bin/chmod -R ${mode} "${gitdir}"
echo "[-] git checkout ${branch}" echo "[-] git checkout ${branch}"
if ! doas -u _portzap "${git}" \ doas -u _portzap "${git}" \
checkout -t \ checkout -t \
origin/"${branch}" \ origin/"${branch}" \
> /dev/null 2>&1; then > /dev/null 2>&1
r="${?}" echo "[-] Done"
echo "[-] 'git checkout' exited with an error"
exit "${r}"
else
echo "[-] Done"
fi