{"thread":{"id":"10004","subject":"[PATCH 2/3] Cleanup unnecessary break in remote.c","startedAt":"2007-09-25T04:13:19Z","lastAt":"2007-09-25T04:13:19Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"53959","messageId":"20070925041319.GB11363@spearce.org","threadId":"10004","inReplyTo":null,"subject":"[PATCH 2/3] Cleanup unnecessary break in remote.c","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-09-25T04:13:19Z","receivedAt":"2007-09-25T04:13:19Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"This simple change makes the body of \"case 0\" easier to read; no\nmatter what the value of matched_src is we want to break out of\nthe switch and not fall through.  We only want to display an error\nif matched_src is NULL, as this indicates there is no local branch\nmatching the input.\n\nAlso modified the default case's error message so it uses one less\nline of text.  Even at 8 column per tab indentation we still don't\nbreak 80 columns with this new formatting.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n remote.c |    9 +++------\n 1 files changed, 3 insertions(+), 6 deletions(-)\n\ndiff --git a/remote.c b/remote.c\nindex ac354f3..2166a2b 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -598,15 +598,12 @@ static int match_explicit(struct ref *src, struct ref *dst,\n \t\t * way to delete 'other' ref at the remote end.\n \t\t */\n \t\tmatched_src = try_explicit_object_name(rs->src);\n-\t\tif (matched_src)\n-\t\t\tbreak;\n-\t\terror(\"src refspec %s does not match any.\",\n-\t\t      rs->src);\n+\t\tif (!matched_src)\n+\t\t\terror(\"src refspec %s does not match any.\", rs->src);\n \t\tbreak;\n \tdefault:\n \t\tmatched_src = NULL;\n-\t\terror(\"src refspec %s matches more than one.\",\n-\t\t      rs->src);\n+\t\terror(\"src refspec %s matches more than one.\", rs->src);\n \t\tbreak;\n \t}\n \n-- \n1.5.3.2.124.g2456-dirty\n"}]}