cmd_push: set "atomic" bit directly
This makes the code shorter and more obvious by removing an unnecessary interim variable. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Feb 16, 2015 at 01:12 UTC
d16c33b4c11cda583ca2b6f7b81da3ac2fdebfa4
1 file changed
+1
-5
builtin/push.c
+1
-5
@@ -486,7 +486,6 @@ int cmd_push(int argc, const char **argv, const char *prefix)
486
int flags = 0;
487
int tags = 0;
488
int rc;
489
- int atomic = 0;
489
const char *repo = NULL; /* default repository */
490
struct option options[] = {
491
OPT__VERBOSITY(&verbosity),
@@ -518,7 +517,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
517
OPT_BIT(0, "follow-tags", &flags, N_("push missing but relevant tags"),
518
TRANSPORT_PUSH_FOLLOW_TAGS),
519
OPT_BIT(0, "signed", &flags, N_("GPG sign the push"), TRANSPORT_PUSH_CERT),
521
- OPT_BOOL(0, "atomic", &atomic, N_("request atomic transaction on remote side")),
520
+ OPT_BIT(0, "atomic", &flags, N_("request atomic transaction on remote side"), TRANSPORT_PUSH_ATOMIC),
521
OPT_END()
522
};
523
@@ -534,9 +533,6 @@ int cmd_push(int argc, const char **argv, const char *prefix)
533
if (tags)
534
add_refspec("refs/tags/*");
535
537
- if (atomic)
538
- flags |= TRANSPORT_PUSH_ATOMIC;
539
-
536
if (argc > 0) {
537
repo = argv[0];
538
set_refspecs(argv + 1, argc - 1, repo);