diff mbox series

[v5,4/7] bisect--helper: use `res` instead of return in BISECT_RESET case option

Message ID 20210203215438.96760-5-mirucam@gmail.com (mailing list archive)
State Accepted
Commit b7a6f163d6273896e4f846f63dd711be0174522b
Headers show
Series Finish converting git bisect to C part 3 | expand

Commit Message

Miriam R. Feb. 3, 2021, 9:54 p.m. UTC
From: Pranit Bauva <pranit.bauva@gmail.com>

Use `res` variable to store `bisect_reset()` output in BISECT_RESET
case option to make bisect--helper.c more consistent.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Miriam Rubio <mirucam@gmail.com>
---
 builtin/bisect--helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
index 36b50e3aa8..fd018ddda5 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect--helper.c
@@ -1047,7 +1047,8 @@  int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
 	case BISECT_RESET:
 		if (argc > 1)
 			return error(_("--bisect-reset requires either no argument or a commit"));
-		return !!bisect_reset(argc ? argv[0] : NULL);
+		res = bisect_reset(argc ? argv[0] : NULL);
+		break;
 	case CHECK_AND_SET_TERMS:
 		if (argc != 3)
 			return error(_("--check-and-set-terms requires 3 arguments"));