Skip to content

Commit d16c33b

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 06038cd commit d16c33b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

builtin/push.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ int cmd_push(int argc, const char **argv, const char *prefix)
486486
int flags = 0;
487487
int tags = 0;
488488
int rc;
489-
int atomic = 0;
490489
const char *repo = NULL; /* default repository */
491490
struct option options[] = {
492491
OPT__VERBOSITY(&verbosity),
@@ -518,7 +517,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
518517
OPT_BIT(0, "follow-tags", &flags, N_("push missing but relevant tags"),
519518
TRANSPORT_PUSH_FOLLOW_TAGS),
520519
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),
522521
OPT_END()
523522
};
524523

@@ -534,9 +533,6 @@ int cmd_push(int argc, const char **argv, const char *prefix)
534533
if (tags)
535534
add_refspec("refs/tags/*");
536535

537-
if (atomic)
538-
flags |= TRANSPORT_PUSH_ATOMIC;
539-
540536
if (argc > 0) {
541537
repo = argv[0];
542538
set_refspecs(argv + 1, argc - 1, repo);

0 commit comments

Comments
 (0)