Skip to content

Commit 7273968

Browse files
felipecgitster
authored andcommitted
push: return immediately in trivial switch case
There's no need to break when nothing else will be executed. Will help next patches. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 533e032 commit 7273968

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

builtin/push.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,25 +257,25 @@ static void setup_default_push_refspecs(struct remote *remote)
257257
default:
258258
case PUSH_DEFAULT_MATCHING:
259259
refspec_append(&rs, ":");
260-
break;
260+
return;
261261

262262
case PUSH_DEFAULT_UNSPECIFIED:
263263
case PUSH_DEFAULT_SIMPLE:
264264
setup_push_simple(remote, branch, same_remote);
265-
break;
265+
return;
266266

267267
case PUSH_DEFAULT_UPSTREAM:
268268
setup_push_upstream(remote, branch, same_remote);
269-
break;
269+
return;
270270

271271
case PUSH_DEFAULT_CURRENT:
272272
setup_push_current(remote, branch);
273-
break;
273+
return;
274274

275275
case PUSH_DEFAULT_NOTHING:
276276
die(_("You didn't specify any refspecs to push, and "
277277
"push.default is \"nothing\"."));
278-
break;
278+
return;
279279
}
280280
}
281281

0 commit comments

Comments
 (0)