@@ -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{
@@ -204,9 +203,9 @@ static void setup_push_current(struct remote *remote, struct branch *branch)
204203}
205204
206205static char warn_unspecified_push_default_msg [] =
207- N_ ("push.default is unset; its implicit value is changing in\n"
206+ N_ ("push.default is unset; its implicit value has changed in\n"
208207 "Git 2.0 from 'matching' to 'simple'. To squelch this message\n"
209- "and maintain the current behavior after the default changes , use:\n"
208+ "and maintain the traditional behavior, use:\n"
210209 "\n"
211210 " git config --global push.default matching\n"
212211 "\n"
@@ -247,14 +246,14 @@ static void setup_default_push_refspecs(struct remote *remote)
247246
248247 switch (push_default ) {
249248 default :
250- case PUSH_DEFAULT_UNSPECIFIED :
251- default_matching_used = 1 ;
252- warn_unspecified_push_default_configuration ();
253- /* fallthru */
254249 case PUSH_DEFAULT_MATCHING :
255250 add_refspec (":" );
256251 break ;
257252
253+ case PUSH_DEFAULT_UNSPECIFIED :
254+ warn_unspecified_push_default_configuration ();
255+ /* fallthru */
256+
258257 case PUSH_DEFAULT_SIMPLE :
259258 if (triangular )
260259 setup_push_current (remote , branch );
@@ -283,12 +282,6 @@ static const char message_advice_pull_before_push[] =
283282 "'git pull ...') before pushing again.\n"
284283 "See the 'Note about fast-forwards' in 'git push --help' for details." );
285284
286- static const char message_advice_use_upstream [] =
287- N_ ("Updates were rejected because a pushed branch tip is behind its remote\n"
288- "counterpart. If you did not intend to push that branch, you may want to\n"
289- "specify branches to push or set the 'push.default' configuration variable\n"
290- "to 'simple', 'current' or 'upstream' to push only the current branch." );
291-
292285static const char message_advice_checkout_pull_push [] =
293286 N_ ("Updates were rejected because a pushed branch tip is behind its remote\n"
294287 "counterpart. Check out this branch and integrate the remote changes\n"
@@ -317,13 +310,6 @@ static void advise_pull_before_push(void)
317310 advise (_ (message_advice_pull_before_push ));
318311}
319312
320- static void advise_use_upstream (void )
321- {
322- if (!advice_push_non_ff_default || !advice_push_update_rejected )
323- return ;
324- advise (_ (message_advice_use_upstream ));
325- }
326-
327313static void advise_checkout_pull_push (void )
328314{
329315 if (!advice_push_non_ff_matching || !advice_push_update_rejected )
@@ -385,10 +371,7 @@ static int push_with_options(struct transport *transport, int flags)
385371 if (reject_reasons & REJECT_NON_FF_HEAD ) {
386372 advise_pull_before_push ();
387373 } else if (reject_reasons & REJECT_NON_FF_OTHER ) {
388- if (default_matching_used )
389- advise_use_upstream ();
390- else
391- advise_checkout_pull_push ();
374+ advise_checkout_pull_push ();
392375 } else if (reject_reasons & REJECT_ALREADY_EXISTS ) {
393376 advise_ref_already_exists ();
394377 } else if (reject_reasons & REJECT_FETCH_FIRST ) {
0 commit comments