@@ -24,7 +24,6 @@ static int progress = -1;
2424static const char * * refspec ;
2525static int refspec_nr ;
2626static int refspec_alloc ;
27- static int default_matching_used ;
2827
2928static void add_refspec (const char * ref )
3029{
@@ -148,9 +147,9 @@ static void setup_push_upstream(struct remote *remote, int simple)
148147}
149148
150149static char warn_unspecified_push_default_msg [] =
151- N_ ("push.default is unset; its implicit value is changing in\n"
150+ N_ ("push.default is unset; its implicit value has changed in\n"
152151 "Git 2.0 from 'matching' to 'simple'. To squelch this message\n"
153- "and maintain the current behavior after the default changes , use:\n"
152+ "and maintain the traditional behavior, use:\n"
154153 "\n"
155154 " git config --global push.default matching\n"
156155 "\n"
@@ -175,14 +174,14 @@ static void setup_default_push_refspecs(struct remote *remote)
175174{
176175 switch (push_default ) {
177176 default :
178- case PUSH_DEFAULT_UNSPECIFIED :
179- default_matching_used = 1 ;
180- warn_unspecified_push_default_configuration ();
181- /* fallthru */
182177 case PUSH_DEFAULT_MATCHING :
183178 add_refspec (":" );
184179 break ;
185180
181+ case PUSH_DEFAULT_UNSPECIFIED :
182+ warn_unspecified_push_default_configuration ();
183+ /* fallthru */
184+
186185 case PUSH_DEFAULT_SIMPLE :
187186 setup_push_upstream (remote , 1 );
188187 break ;
@@ -208,12 +207,6 @@ static const char message_advice_pull_before_push[] =
208207 "before pushing again.\n"
209208 "See the 'Note about fast-forwards' in 'git push --help' for details." );
210209
211- static const char message_advice_use_upstream [] =
212- N_ ("Updates were rejected because a pushed branch tip is behind its remote\n"
213- "counterpart. If you did not intend to push that branch, you may want to\n"
214- "specify branches to push or set the 'push.default' configuration variable\n"
215- "to 'simple', 'current' or 'upstream' to push only the current branch." );
216-
217210static const char message_advice_checkout_pull_push [] =
218211 N_ ("Updates were rejected because a pushed branch tip is behind its remote\n"
219212 "counterpart. Check out this branch and merge the remote changes\n"
@@ -227,13 +220,6 @@ static void advise_pull_before_push(void)
227220 advise (_ (message_advice_pull_before_push ));
228221}
229222
230- static void advise_use_upstream (void )
231- {
232- if (!advice_push_non_ff_default || !advice_push_nonfastforward )
233- return ;
234- advise (_ (message_advice_use_upstream ));
235- }
236-
237223static void advise_checkout_pull_push (void )
238224{
239225 if (!advice_push_non_ff_matching || !advice_push_nonfastforward )
@@ -272,10 +258,7 @@ static int push_with_options(struct transport *transport, int flags)
272258 advise_pull_before_push ();
273259 break ;
274260 case NON_FF_OTHER :
275- if (default_matching_used )
276- advise_use_upstream ();
277- else
278- advise_checkout_pull_push ();
261+ advise_checkout_pull_push ();
279262 break ;
280263 }
281264
0 commit comments