Thread (7 messages) flat view 7 messages, 2 authors, 2024-09-12
STALE703d

[PATCH 2/4] remote: print an error if refspec cannot be removed

From: Phillip Wood via GitGitGadget <hidden>
Date: 2024-09-11 15:18:41
Subsystem: the rest · Maintainer: Linus Torvalds

From: Phillip Wood <redacted>

If the existing fetch refspecs cannot be removed when replacing the set
of branches to fetch with "git remote set-branches" the command silently
fails. Add an error message to tell the user what when wrong.

Signed-off-by: Phillip Wood <redacted>
---
 builtin/remote.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/builtin/remote.c b/builtin/remote.c
index 794396ba02f..4dbf7a4c506 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -1603,6 +1603,7 @@ static int set_remote_branches(const char *remotename, const char **branches,
 	}
 
 	if (!add_mode && remove_all_fetch_refspecs(key.buf)) {
+		error(_("could not remove existing fetch refspec"));
 		strbuf_release(&key);
 		return 1;
 	}
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help