From 94493d6040feb0f2835c00e10e394ed8cdfffb89 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sat, 20 Apr 2024 01:55:41 -0300 Subject: [PATCH] Allow checkout after clone to fail When $PORTZAP_BRANCH happens to be the default branch, 'git checkout' will exit with an error. Ignore. --- libexec/portzap/portzap-clone | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libexec/portzap/portzap-clone b/libexec/portzap/portzap-clone index bbf3d7c..0834e86 100755 --- a/libexec/portzap/portzap-clone +++ b/libexec/portzap/portzap-clone @@ -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"