{"thread":{"id":"5794","subject":"git-fetch --update-head-ok ?","startedAt":"2006-10-03T12:34:52Z","lastAt":"2006-10-11T05:25:32Z","messageCount":2,"participants":["Martin Waitz","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"28153","messageId":"20061003123452.GK2871@admingilde.org","threadId":"5794","inReplyTo":null,"subject":"git-fetch --update-head-ok ?","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-10-03T12:34:52Z","receivedAt":"2006-10-03T12:34:52Z","isPatch":false,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nI have no idea why there is a --update-head-ok, but the code looks\nlike it has a typo:\n\ndiff --git a/git-fetch.sh b/git-fetch.sh\nindex 09a5d6c..5843639 100755\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -433,7 +433,7 @@ esac\n # If the original head was empty (i.e. no \"master\" yet), or\n # if we were told not to worry, we do not have to check.\n case \",$update_head_ok,$orig_head,\" in\n-*,, | t,* )\n+*,, | ,t,* )\n        ;;\n *)\n        curr_head=$(git-rev-parse --verify HEAD 2>/dev/null)\n\n-- \nMartin Waitz\n"},{"id":"28577","messageId":"7vzmc3whir.fsf@assigned-by-dhcp.cox.net","threadId":"5794","inReplyTo":"20061003123452.GK2871@admingilde.org","subject":"Re: git-fetch --update-head-ok ?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-11T05:25:32Z","receivedAt":"2006-10-11T05:25:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Waitz <tali@admingilde.org> writes:\n\n> I have no idea why there is a --update-head-ok, but the code looks\n> like it has a typo:\n\nI looked at it again, and indeed it looks like a typo.\n\n> @@ -433,7 +433,7 @@ esac\n>  # If the original head was empty (i.e. no \"master\" yet), or\n>  # if we were told not to worry, we do not have to check.\n>  case \",$update_head_ok,$orig_head,\" in\n> -*,, | t,* )\n> +*,, | ,t,* )\n>         ;;\n>  *)\n>         curr_head=$(git-rev-parse --verify HEAD 2>/dev/null)\n\nInterestingly enough, when update_head_ok is set, orig_head\nnever is so the typo does not matter at all by pure accident (it\nwas there from the very first version that introduced this\nfeature).\n\nIt should just be something like this:\n\n        case \"$orig_head\" in\n        '')\n                ;;\n        ?*)\n                curr_head=$(git-rev-parse --verify HEAD 2>/dev/null)\n                ...\n"}]}