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

[PATCH v1] builtin/checkout.c: replace bit-shift values for macros in call to check_stages

From
Edmundo Carmona Antoranz <eantoranz@gmail.com>
Date
Jun 7, 2020, 05:48 UTC
Message-ID
<20200607054849.1014185-1-eantoranz@gmail.com>

Currently a call to check_stages is using bit-shift values to define what will be used as the first argument. If the reader doesn't know what the values are from heart, they have to go dig in cache.h what each value is.

This patch is replacing those values for the macros from cache.h so that it's clear at first sight what they are (CE_ENTRY_REMOVED, CE_ENTRY_ADDED)

Signed-off-by: Edmundo Carmona Antoranz <eantoranz@gmail.com>
---
 builtin/checkout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/checkout.c b/builtin/checkout.c
index ffa776c6e1..3a644b31f6 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -397,7 +397,7 @@ static int checkout_paths(const struct checkout_opts *opts,
 			} else if (opts->writeout_stage) {
 				errs |= check_stage(opts->writeout_stage, ce, pos, opts->overlay_mode);
 			} else if (opts->merge) {
-				errs |= check_stages((1<<2) | (1<<3), ce, pos);
+				errs |= check_stages(CE_ENTRY_REMOVED | CE_ENTRY_ADDED, ce, pos);
 			} else {
 				errs = 1;
 				error(_("path '%s' is unmerged"), ce->name);
-- 
2.26.2
Next: Edmundo Carmona Antoranz
Message 1 of 4 in “builtin/checkout.c: replace bit-shift values for macros in call to check_stages”
  1. builtin/checkout.c: replace bit-shift values for macros in call to check_stagesEdmundo Carmona Antoranz, Jun 7, 2020
  2. Edmundo Carmona AntoranzJun 7, 2020
  3. Junio C HamanoJun 9, 2020
  4. Edmundo Carmona AntoranzJun 10, 2020

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.