]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'gc/branch-recurse-submodules-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 4 Apr 2022 17:56:22 +0000 (10:56 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Apr 2022 17:56:23 +0000 (10:56 -0700)
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
  branch: remove negative exit code
  branch --set-upstream-to: be consistent when advising
  branch: give submodule updating advice before exit
  branch: support more tracking modes when recursing

1  2 
branch.c
builtin/submodule--helper.c
t/t3207-branch-submodule.sh

diff --cc branch.c
index 6b31df539a5f72e07bc5efb4592f703ddd70d28c,b673143cbe3f419a76990d5754aaa03be0eb2108..581afd634dad8097aab4d7006661f8395ce40c80
+++ b/branch.c
@@@ -385,14 -383,12 +388,12 @@@ static void dwim_branch_start(struct re
        real_ref = NULL;
        if (get_oid_mb(start_name, &oid)) {
                if (explicit_tracking) {
-                       if (advice_enabled(ADVICE_SET_UPSTREAM_FAILURE)) {
-                               error(_(upstream_missing), start_name);
-                               advise(_(upstream_advice));
-                               exit(1);
-                       }
-                       die(_(upstream_missing), start_name);
+                       int code = die_message(_(upstream_missing), start_name);
+                       advise_if_enabled(ADVICE_SET_UPSTREAM_FAILURE,
+                                         _(upstream_advice));
+                       exit(code);
                }
 -              die(_("Not a valid object name: '%s'."), start_name);
 +              die(_("not a valid object name: '%s'"), start_name);
        }
  
        switch (dwim_ref(start_name, strlen(start_name), &oid, &real_ref, 0)) {
Simple merge
Simple merge