git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ross Lagerwall <rosslagerwall@gmail.com>
To: git@vger.kernel.org
Cc: Ross Lagerwall <rosslagerwall@gmail.com>
Subject: [PATCH] remote: Ignore failure to remove missing branch.<name>.merge
Date: Sat, 18 Feb 2017 00:23:41 +0000	[thread overview]
Message-ID: <20170218002341.23099-1-rosslagerwall@gmail.com> (raw)

If a branch is configured with a default remote but no
branch.<name>.merge and then the remote is removed, git fails to remove
the remote with:
"fatal: could not unset 'branch.<name>.merge'"

Instead, ignore this since it is not an error and shouldn't prevent the
remote from being removed.

Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
---
 builtin/remote.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/builtin/remote.c b/builtin/remote.c
index e52cf3925..5dd22c2eb 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -769,7 +769,9 @@ static int rm(int argc, const char **argv)
 				strbuf_reset(&buf);
 				strbuf_addf(&buf, "branch.%s.%s",
 						item->string, *k);
-				git_config_set(buf.buf, NULL);
+				result = git_config_set_gently(buf.buf, NULL);
+				if (result && result != CONFIG_NOTHING_SET)
+					die(_("COULd not unset '%s'"), buf.buf);
 			}
 		}
 	}
-- 
2.11.0


             reply	other threads:[~2017-02-18  0:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-18  0:23 Ross Lagerwall [this message]
2017-02-21 19:32 ` [PATCH] remote: Ignore failure to remove missing branch.<name>.merge Junio C Hamano
2017-02-21 20:38   ` Ross Lagerwall
2017-02-21 22:03     ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20170218002341.23099-1-rosslagerwall@gmail.com \
    --to=rosslagerwall@gmail.com \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).