[PATCH] remote: Ignore failure to remove missing branch.<name>.merge

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

 



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@xxxxxxxxx>
---
 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




[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]