File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -603,13 +603,16 @@ sub mw_import_ref {
603603}
604604
605605sub error_non_fast_forward {
606- # Native git-push would show this after the summary.
607- # We can't ask it to display it cleanly, so print it
608- # ourselves before.
609- print STDERR " To prevent you from losing history, non-fast-forward updates were rejected\n " ;
610- print STDERR " Merge the remote changes (e.g. 'git pull') before pushing again. See the\n " ;
611- print STDERR " 'Note about fast-forwards' section of 'git push --help' for details.\n " ;
612-
606+ my $advice = run_git(" config --bool advice.pushNonFastForward" );
607+ chomp ($advice );
608+ if ($advice ne " false" ) {
609+ # Native git-push would show this after the summary.
610+ # We can't ask it to display it cleanly, so print it
611+ # ourselves before.
612+ print STDERR " To prevent you from losing history, non-fast-forward updates were rejected\n " ;
613+ print STDERR " Merge the remote changes (e.g. 'git pull') before pushing again. See the\n " ;
614+ print STDERR " 'Note about fast-forwards' section of 'git push --help' for details.\n " ;
615+ }
613616 print STDOUT " error $_ [0] \" non-fast-forward\"\n " ;
614617 return 0;
615618}
You can’t perform that action at this time.
0 commit comments