Fix unconditional early exit in cg-fetch v2
PATCH 1/1 Fix unconditional early exit in cg-fetch v2
From: Paolo 'Blaisorblade' Giarrusso <[email protected]>
When invoking cg-fetch, after fetching tags it exits here, for an overlooked error handling. Replace the exit with an early return.
This means, for instance, we exit without reporting the tag updates and without removing the "fetch in progress" marker - leading to unconditional "Recovering from interrupted fetch" at the very beginning with rsync transport. Indeed, this is fixed by this patch.
Signed-off-by Paolo 'Blaisorblade' Giarrusso <[email protected]>
---
cg-fetch | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
cg-fetch +3 -2
@@ -189,9 +189,10 @@ fetch_tags() [ -d "$_git/refs/tags" ] || mkdir -p "$_git/refs/tags" if [ "$get" = "get_rsync" ]; then - $get -i -s -u -d "$uri/refs/tags" "$_git/refs/tags" || + if ! $get -i -s -u -d "$uri/refs/tags" "$_git/refs/tags"; then echo "unable to get tags list (non-fatal)" >&2 - exit $? + return $? + fi fi git-ls-remote --tags "$uri" |