{"thread":{"id":"2885","subject":"[PATCH] Fix unconditional early exit in cg-fetch v2","startedAt":"2005-12-20T15:24:58Z","lastAt":"2005-12-20T15:24:58Z","messageCount":1,"participants":["Paolo 'Blaisorblade' Giarrusso"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"13839","messageId":"20051220152458.1302.84228.stgit@zion.home.lan","threadId":"2885","inReplyTo":null,"subject":"[PATCH] Fix unconditional early exit in cg-fetch v2","fromName":"Paolo 'Blaisorblade' Giarrusso","fromEmail":"blaisorblade@yahoo.it","sentAt":"2005-12-20T15:24:58Z","receivedAt":"2005-12-20T15:24:58Z","isPatch":true,"sender":{"key":"blaisorblade@yahoo.it","avatar":null},"body":"\nFrom: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n\nWhen invoking cg-fetch, after fetching tags it exits here, for an overlooked\nerror handling. Replace the exit with an early return.\n\nThis means, for instance, we exit without reporting the tag updates and without\nremoving the \"fetch in progress\" marker - leading to unconditional \"Recovering\nfrom interrupted fetch\" at the very beginning with rsync transport. Indeed, this\nis fixed by this patch.\n\nSigned-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>\n---\n\n cg-fetch |    5 +++--\n 1 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/cg-fetch b/cg-fetch\nindex a2865ae..074aa14 100755\n--- a/cg-fetch\n+++ b/cg-fetch\n@@ -189,9 +189,10 @@ fetch_tags()\n \t[ -d \"$_git/refs/tags\" ] || mkdir -p \"$_git/refs/tags\"\n \n \tif [ \"$get\" = \"get_rsync\" ]; then\n-\t\t$get -i -s -u -d \"$uri/refs/tags\" \"$_git/refs/tags\" ||\n+\t\tif ! $get -i -s -u -d \"$uri/refs/tags\" \"$_git/refs/tags\"; then\n \t\t\techo \"unable to get tags list (non-fatal)\" >&2\n-\t\texit $?\n+\t\t\treturn $?\n+\t\tfi\n \tfi\n \n \tgit-ls-remote --tags \"$uri\" |\n"}]}