[PATCH] git-remote: do not complain on multiple URLs for a remote

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Having more than one URL for a remote is perfectly normal when
the remote is defined to push to multiple places.  Get rid of
the annoying "Warning" message.

Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
---
 git-remote.perl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-remote.perl b/git-remote.perl
index 5cd6951..b30ed73 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -7,10 +7,10 @@ my $git = Git->repository();
 sub add_remote_config {
 	my ($hash, $name, $what, $value) = @_;
 	if ($what eq 'url') {
-		if (exists $hash->{$name}{'URL'}) {
-			print STDERR "Warning: more than one remote.$name.url\n";
+		# Having more than one is Ok -- it is used for push.
+		if (! exists $hash->{'URL'}) {
+			$hash->{$name}{'URL'} = $value;
 		}
-		$hash->{$name}{'URL'} = $value;
 	}
 	elsif ($what eq 'fetch') {
 		$hash->{$name}{'FETCH'} ||= [];
-- 
1.5.4.3.339.gad2d1

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux