@@ -26,7 +26,6 @@ static struct push_cas_option cas;
2626static const char * * refspec ;
2727static int refspec_nr ;
2828static int refspec_alloc ;
29- static int default_matching_used ;
3029
3130static void add_refspec (const char * ref )
3231{
@@ -164,9 +163,9 @@ static void setup_push_current(struct remote *remote, struct branch *branch)
164163}
165164
166165static char warn_unspecified_push_default_msg [] =
167- N_ ("push.default is unset; its implicit value is changing in\n"
166+ N_ ("push.default is unset; its implicit value has changed in\n"
168167 "Git 2.0 from 'matching' to 'simple'. To squelch this message\n"
169- "and maintain the current behavior after the default changes , use:\n"
168+ "and maintain the traditional behavior, use:\n"
170169 "\n"
171170 " git config --global push.default matching\n"
172171 "\n"
@@ -177,7 +176,7 @@ N_("push.default is unset; its implicit value is changing in\n"
177176 "When push.default is set to 'matching', git will push local branches\n"
178177 "to the remote branches that already exist with the same name.\n"
179178 "\n"
180- "In Git 2.0, Git will default to the more conservative 'simple'\n"
179+ "Since Git 2.0, Git defaults to the more conservative 'simple'\n"
181180 "behavior, which only pushes the current branch to the corresponding\n"
182181 "remote branch that 'git pull' uses to update the current branch.\n"
183182 "\n"
@@ -207,14 +206,14 @@ static void setup_default_push_refspecs(struct remote *remote)
207206
208207 switch (push_default ) {
209208 default :
210- case PUSH_DEFAULT_UNSPECIFIED :
211- default_matching_used = 1 ;
212- warn_unspecified_push_default_configuration ();
213- /* fallthru */
214209 case PUSH_DEFAULT_MATCHING :
215210 add_refspec (":" );
216211 break ;
217212
213+ case PUSH_DEFAULT_UNSPECIFIED :
214+ warn_unspecified_push_default_configuration ();
215+ /* fallthru */
216+
218217 case PUSH_DEFAULT_SIMPLE :
219218 if (triangular )
220219 setup_push_current (remote , branch );
@@ -243,12 +242,6 @@ static const char message_advice_pull_before_push[] =
243242 "'git pull ...') before pushing again.\n"
244243 "See the 'Note about fast-forwards' in 'git push --help' for details." );
245244
246- static const char message_advice_use_upstream [] =
247- N_ ("Updates were rejected because a pushed branch tip is behind its remote\n"
248- "counterpart. If you did not intend to push that branch, you may want to\n"
249- "specify branches to push or set the 'push.default' configuration variable\n"
250- "to 'simple', 'current' or 'upstream' to push only the current branch." );
251-
252245static const char message_advice_checkout_pull_push [] =
253246 N_ ("Updates were rejected because a pushed branch tip is behind its remote\n"
254247 "counterpart. Check out this branch and integrate the remote changes\n"
@@ -277,13 +270,6 @@ static void advise_pull_before_push(void)
277270 advise (_ (message_advice_pull_before_push ));
278271}
279272
280- static void advise_use_upstream (void )
281- {
282- if (!advice_push_non_ff_default || !advice_push_update_rejected )
283- return ;
284- advise (_ (message_advice_use_upstream ));
285- }
286-
287273static void advise_checkout_pull_push (void )
288274{
289275 if (!advice_push_non_ff_matching || !advice_push_update_rejected )
@@ -345,10 +331,7 @@ static int push_with_options(struct transport *transport, int flags)
345331 if (reject_reasons & REJECT_NON_FF_HEAD ) {
346332 advise_pull_before_push ();
347333 } else if (reject_reasons & REJECT_NON_FF_OTHER ) {
348- if (default_matching_used )
349- advise_use_upstream ();
350- else
351- advise_checkout_pull_push ();
334+ advise_checkout_pull_push ();
352335 } else if (reject_reasons & REJECT_ALREADY_EXISTS ) {
353336 advise_ref_already_exists ();
354337 } else if (reject_reasons & REJECT_FETCH_FIRST ) {
0 commit comments