git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/4] branch: remove negative exit code

From
Glen Choo via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 29, 2022, 20:01 UTC
Message-ID
<fb2b472d9ae66bcdcde6a8417486172a47c71258.1648584079.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1190.git.1648584079.gitgitgadget@gmail.com>
From: Glen Choo <chooglen@google.com>

Replace an instance of "exit(-1)" with "exit(1)". We don't use negative exit codes - they are misleading because Unix machines will coerce them to 8-bit unsigned values, losing the sign.

Signed-off-by: Glen Choo <chooglen@google.com>
---
 branch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/branch.c b/branch.c
index 4a8796489c7..eb231b950bb 100644
--- a/branch.c
+++ b/branch.c
@@ -263,7 +263,7 @@ static void setup_tracking(const char *new_ref, const char *orig_ref,
 		string_list_append(tracking.srcs, orig_ref);
 	if (install_branch_config_multiple_remotes(config_flags, new_ref,
 				tracking.remote, tracking.srcs) < 0)
-		exit(-1);
+		exit(1);
 
 cleanup:
 	string_list_clear(&tracking_srcs, 0);
-- 
gitgitgadget
Previous: Glen ChooNext: Glen Choo via GitGitGadget
Message 10 of 21 in “branch --recurse-submodules: Bug fixes and clean ups”
  1. 0/4 branch --recurse-submodules: Bug fixes and clean upsGlen Choo via GitGitGadget, Mar 29, 2022
  2. 1/4 branch: support more tracking modes when recursingGlen Choo via GitGitGadget, Mar 29, 2022
  3. Junio C HamanoMar 30, 2022
  4. Glen ChooMar 30, 2022
  5. 2/4 branch: give submodule updating advice before exitGlen Choo via GitGitGadget, Mar 29, 2022
  6. Junio C HamanoMar 30, 2022
  7. 3/4 branch --set-upstream-to: be consistent when advisingGlen Choo via GitGitGadget, Mar 29, 2022
  8. Ævar Arnfjörð BjarmasonMar 30, 2022
  9. Glen ChooMar 31, 2022
  10. 4/4 branch: remove negative exit codeGlen Choo via GitGitGadget, Mar 29, 2022
  11. 0/4 branch --recurse-submodules: Bug fixes and clean upsGlen Choo via GitGitGadget, Mar 31, 2022
  12. 1/4 branch: support more tracking modes when recursingGlen Choo via GitGitGadget, Mar 31, 2022
  13. 2/4 branch: give submodule updating advice before exitGlen Choo via GitGitGadget, Mar 31, 2022
  14. 3/4 branch --set-upstream-to: be consistent when advisingGlen Choo via GitGitGadget, Mar 31, 2022
  15. 4/4 branch: remove negative exit codeGlen Choo via GitGitGadget, Mar 31, 2022
  16. Junio C HamanoMar 31, 2022
  17. 1/2 branch: rework comments for future developersJunio C Hamano, Mar 31, 2022
  18. 2/2 branch.c: simplify advice-and-die sequenceJunio C Hamano, Mar 31, 2022
  19. Ævar Arnfjörð BjarmasonApr 1, 2022
  20. Glen ChooApr 1, 2022
  21. Junio C HamanoApr 1, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.