Git development
 help / color / mirror / Atom feed
From: Victor Bogado da Silva Lins <victor@bogado.net>
To: git@vger.kernel.org
Subject: [PATCH] Fix remote_get so it will return NULL when no remote is found.
Date: Thu, 05 Jun 2008 09:48:11 -0300	[thread overview]
Message-ID: <1212670091.30293.3.camel@omicron.ep.petrobras.com.br> (raw)

>From 0cf45f264cf7f1b3aa3a8875109fbf4c03d56126 Mon Sep 17 00:00:00 2001
From: Victor Bogado <victor@bogado.net>
Date: Thu, 5 Jun 2008 09:36:41 -0300
Subject: [PATCH] Fix remote_get so it will return NULL when no remote is
found.

remote_get should return NULL when there is no remote with that name, at
least this is what remote.c's rm() function seems to think. As this is a
reasonable assumption, and it seems that the function remote_get is
acutally trying to do this, I fixed the test so it will test if the URL
is equal to the name of the remote.
---
 remote.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/remote.c b/remote.c
index 91e3b11..62b3611 100644
--- a/remote.c
+++ b/remote.c
@@ -598,7 +598,7 @@ struct remote *remote_get(const char *name)
 	}
 	if (!ret->url)
 		add_url_alias(ret, name);
-	if (!ret->url)
+	if (!strcmp(*ret->url,ret->name))
 		return NULL;
 	ret->fetch = parse_fetch_refspec(ret->fetch_refspec_nr,
ret->fetch_refspec);
 	ret->push = parse_push_refspec(ret->push_refspec_nr,
ret->push_refspec);
-- 
1.5.5

             reply	other threads:[~2008-06-05 12:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05 12:48 Victor Bogado da Silva Lins [this message]
2008-06-05 13:26 ` [PATCH] Fix remote_get so it will return NULL when no remote is found Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1212670091.30293.3.camel@omicron.ep.petrobras.com.br \
    --to=victor@bogado.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox