Skip to content

Commit

Permalink
Cleanup unnecessary break in remote.c
Browse files Browse the repository at this point in the history
This simple change makes the body of "case 0" easier to read; no
matter what the value of matched_src is we want to break out of
the switch and not fall through.  We only want to display an error
if matched_src is NULL, as this indicates there is no local branch
matching the input.

Also modified the default case's error message so it uses one less
line of text.  Even at 8 column per tab indentation we still don't
break 80 columns with this new formatting.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Sep 25, 2007
1 parent 009c5bc commit 7dfee37
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,15 +598,12 @@ static int match_explicit(struct ref *src, struct ref *dst,
* way to delete 'other' ref at the remote end.
*/
matched_src = try_explicit_object_name(rs->src);
if (matched_src)
break;
error("src refspec %s does not match any.",
rs->src);
if (!matched_src)
error("src refspec %s does not match any.", rs->src);
break;
default:
matched_src = NULL;
error("src refspec %s matches more than one.",
rs->src);
error("src refspec %s matches more than one.", rs->src);
break;
}

Expand Down

0 comments on commit 7dfee37

Please sign in to comment.