git-remote-mediawiki: obey advice.pushNonFastForward
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
		 Matthieu Moy
					Matthieu Moy
				
			
				
					committed by
					
						 Junio C Hamano
						Junio C Hamano
					
				
			
			
				
	
			
			
			 Junio C Hamano
						Junio C Hamano
					
				
			
						parent
						
							3c1ed90ec3
						
					
				
				
					commit
					fd47d7b94d
				
			| @ -603,13 +603,16 @@ sub mw_import_ref { | |||||||
| } | } | ||||||
|  |  | ||||||
| sub error_non_fast_forward { | sub error_non_fast_forward { | ||||||
| 	# Native git-push would show this after the summary. | 	my $advice = run_git("config --bool advice.pushNonFastForward"); | ||||||
| 	# We can't ask it to display it cleanly, so print it | 	chomp($advice); | ||||||
| 	# ourselves before. | 	if ($advice ne "false") { | ||||||
| 	print STDERR "To prevent you from losing history, non-fast-forward updates were rejected\n"; | 		# Native git-push would show this after the summary. | ||||||
| 	print STDERR "Merge the remote changes (e.g. 'git pull') before pushing again. See the\n"; | 		# We can't ask it to display it cleanly, so print it | ||||||
| 	print STDERR "'Note about fast-forwards' section of 'git push --help' for details.\n"; | 		# ourselves before. | ||||||
|  | 		print STDERR "To prevent you from losing history, non-fast-forward updates were rejected\n"; | ||||||
|  | 		print STDERR "Merge the remote changes (e.g. 'git pull') before pushing again. See the\n"; | ||||||
|  | 		print STDERR "'Note about fast-forwards' section of 'git push --help' for details.\n"; | ||||||
|  | 	} | ||||||
| 	print STDOUT "error $_[0] \"non-fast-forward\"\n"; | 	print STDOUT "error $_[0] \"non-fast-forward\"\n"; | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user