Merge branch 'ab/checkout-default-remote'
authorJunio C Hamano <gitster@pobox.com>
Thu, 2 Aug 2018 22:30:41 +0000 (15:30 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Aug 2018 22:30:41 +0000 (15:30 -0700)
"git checkout" and "git worktree add" learned to honor
checkout.defaultRemote when auto-vivifying a local branch out of a
remote tracking branch in a repository with multiple remotes that
have tracking branches that share the same names.

* ab/checkout-default-remote:
checkout & worktree: introduce checkout.defaultRemote
checkout: add advice for ambiguous "checkout <branch>"
builtin/checkout.c: use "ret" variable for return
checkout: pass the "num_matches" up to callers
checkout.c: change "unique" member to "num_matches"
checkout.c: introduce an *_INIT macro
checkout.h: wrap the arguments to unique_tracking_name()
checkout tests: index should be clean after dwim checkout

1  2 
Documentation/config.txt
advice.c
advice.h
builtin/checkout.c
Simple merge
diff --cc advice.c
index 52aa85bdfd9e9054c24445f259125bc4b81be038,75e7dede90a6fe0ae201217f9cc6d2b619480296..3561cd64e9dab0a5b0c52d117253f37a5926f9c7
+++ b/advice.c
@@@ -55,29 -54,29 +56,30 @@@ static struct 
        const char *name;
        int *preference;
  } advice_config[] = {
 -      { "pushupdaterejected", &advice_push_update_rejected },
 -      { "pushnonffcurrent", &advice_push_non_ff_current },
 -      { "pushnonffmatching", &advice_push_non_ff_matching },
 -      { "pushalreadyexists", &advice_push_already_exists },
 -      { "pushfetchfirst", &advice_push_fetch_first },
 -      { "pushneedsforce", &advice_push_needs_force },
 -      { "statushints", &advice_status_hints },
 -      { "statusuoption", &advice_status_u_option },
 -      { "commitbeforemerge", &advice_commit_before_merge },
 -      { "resolveconflict", &advice_resolve_conflict },
 -      { "implicitidentity", &advice_implicit_identity },
 -      { "detachedhead", &advice_detached_head },
 -      { "setupstreamfailure", &advice_set_upstream_failure },
 -      { "objectnamewarning", &advice_object_name_warning },
 -      { "rmhints", &advice_rm_hints },
 -      { "addembeddedrepo", &advice_add_embedded_repo },
 -      { "ignoredhook", &advice_ignored_hook },
 -      { "waitingforeditor", &advice_waiting_for_editor },
 -      { "graftfiledeprecated", &advice_graft_file_deprecated },
 -      { "checkoutambiguousremotebranchname", &advice_checkout_ambiguous_remote_branch_name },
 +      { "pushUpdateRejected", &advice_push_update_rejected },
 +      { "pushNonFFCurrent", &advice_push_non_ff_current },
 +      { "pushNonFFMatching", &advice_push_non_ff_matching },
 +      { "pushAlreadyExists", &advice_push_already_exists },
 +      { "pushFetchFirst", &advice_push_fetch_first },
 +      { "pushNeedsForce", &advice_push_needs_force },
 +      { "statusHints", &advice_status_hints },
 +      { "statusUoption", &advice_status_u_option },
 +      { "commitBeforeMerge", &advice_commit_before_merge },
 +      { "resolveConflict", &advice_resolve_conflict },
 +      { "implicitIdentity", &advice_implicit_identity },
 +      { "detachedHead", &advice_detached_head },
 +      { "setupStreamFailure", &advice_set_upstream_failure },
 +      { "objectNameWarning", &advice_object_name_warning },
 +      { "amWorkDir", &advice_amworkdir },
 +      { "rmHints", &advice_rm_hints },
 +      { "addEmbeddedRepo", &advice_add_embedded_repo },
 +      { "ignoredHook", &advice_ignored_hook },
 +      { "waitingForEditor", &advice_waiting_for_editor },
 +      { "graftFileDeprecated", &advice_graft_file_deprecated },
++      { "checkoutAmbiguousRemoteBranchName", &advice_checkout_ambiguous_remote_branch_name },
  
        /* make this an alias for backward compatibility */
 -      { "pushnonfastforward", &advice_push_update_rejected }
 +      { "pushNonFastForward", &advice_push_update_rejected }
  };
  
  void advise(const char *advice, ...)
diff --cc advice.h
Simple merge
Simple merge