[PATCH 2/4] remote: print an error if refspec cannot be removed
- From
- Phillip Wood via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Sep 11, 2024, 15:18 UTC
- Message-ID
- <a8dfe403d0683aec4265bf920921e45d5b59cec3.1726067917.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.1789.git.1726067917.gitgitgadget@gmail.com>
From: Phillip Wood <phillip.wood@dunelm.org.uk>
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 <phillip.wood@dunelm.org.uk> --- 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