Skip to content

Commit 6cb0c30

Browse files
committed
Merge branch 'gc/branch-recurse-submodules-fix' into next
A handful of obvious clean-ups around a topic that is already in 'master'. * gc/branch-recurse-submodules-fix: branch.c: simplify advice-and-die sequence branch: rework comments for future developers
2 parents 4f1659d + 6696601 commit 6cb0c30

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

branch.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,10 @@ static void dwim_branch_start(struct repository *r, const char *start_name,
388388
real_ref = NULL;
389389
if (get_oid_mb(start_name, &oid)) {
390390
if (explicit_tracking) {
391-
if (advice_enabled(ADVICE_SET_UPSTREAM_FAILURE)) {
392-
int code = die_message(_(upstream_missing),
393-
start_name);
394-
advise(_(upstream_advice));
395-
exit(code);
396-
}
397-
die(_(upstream_missing), start_name);
391+
int code = die_message(_(upstream_missing), start_name);
392+
advise_if_enabled(ADVICE_SET_UPSTREAM_FAILURE,
393+
_(upstream_advice));
394+
exit(code);
398395
}
399396
die(_("not a valid object name: '%s'"), start_name);
400397
}
@@ -554,9 +551,9 @@ static int submodule_create_branch(struct repository *r,
554551
strvec_push(&child.args, "--track=inherit");
555552
break;
556553
case BRANCH_TRACK_UNSPECIFIED:
557-
/* Default for "git checkout". No need to pass --track. */
554+
/* Default for "git checkout". Do not pass --track. */
558555
case BRANCH_TRACK_REMOTE:
559-
/* Default for "git branch". No need to pass --track. */
556+
/* Default for "git branch". Do not pass --track. */
560557
break;
561558
}
562559

0 commit comments

Comments
 (0)