git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remote: Ignore failure to remove missing branch.<name>.merge
@ 2017-02-18  0:23 Ross Lagerwall
  2017-02-21 19:32 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Ross Lagerwall @ 2017-02-18  0:23 UTC (permalink / raw)
  To: git; +Cc: Ross Lagerwall

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-21 22:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-18  0:23 [PATCH] remote: Ignore failure to remove missing branch.<name>.merge Ross Lagerwall
2017-02-21 19:32 ` Junio C Hamano
2017-02-21 20:38   ` Ross Lagerwall
2017-02-21 22:03     ` Junio C Hamano

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 NNTP newsgroup(s).