transport: reformat flag #defines to be more readable
authorBrandon Williams <bmwill@google.com>
Mon, 19 Dec 2016 18:25:31 +0000 (10:25 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Dec 2016 20:26:34 +0000 (12:26 -0800)
All of the #defines for the TRANSPORT_* flags are hardcoded to be
powers of two. This can be error prone when adding a new flag and
is difficult to read. Update these defines to instead use a shift
operation to generate the flags and reformat them.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport.h
index b8e4ee8099260a74e5207048cf2837c9fd686568..1b654583676c622e2b6a159e8ac7a7acf55eeee5 100644 (file)
@@ -131,21 +131,21 @@ struct transport {
        enum transport_family family;
 };
 
-#define TRANSPORT_PUSH_ALL 1
-#define TRANSPORT_PUSH_FORCE 2
-#define TRANSPORT_PUSH_DRY_RUN 4
-#define TRANSPORT_PUSH_MIRROR 8
-#define TRANSPORT_PUSH_PORCELAIN 16
-#define TRANSPORT_PUSH_SET_UPSTREAM 32
-#define TRANSPORT_RECURSE_SUBMODULES_CHECK 64
-#define TRANSPORT_PUSH_PRUNE 128
-#define TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND 256
-#define TRANSPORT_PUSH_NO_HOOK 512
-#define TRANSPORT_PUSH_FOLLOW_TAGS 1024
-#define TRANSPORT_PUSH_CERT_ALWAYS 2048
-#define TRANSPORT_PUSH_CERT_IF_ASKED 4096
-#define TRANSPORT_PUSH_ATOMIC 8192
-#define TRANSPORT_PUSH_OPTIONS 16384
+#define TRANSPORT_PUSH_ALL                     (1<<0)
+#define TRANSPORT_PUSH_FORCE                   (1<<1)
+#define TRANSPORT_PUSH_DRY_RUN                 (1<<2)
+#define TRANSPORT_PUSH_MIRROR                  (1<<3)
+#define TRANSPORT_PUSH_PORCELAIN               (1<<4)
+#define TRANSPORT_PUSH_SET_UPSTREAM            (1<<5)
+#define TRANSPORT_RECURSE_SUBMODULES_CHECK     (1<<6)
+#define TRANSPORT_PUSH_PRUNE                   (1<<7)
+#define TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND (1<<8)
+#define TRANSPORT_PUSH_NO_HOOK                 (1<<9)
+#define TRANSPORT_PUSH_FOLLOW_TAGS             (1<<10)
+#define TRANSPORT_PUSH_CERT_ALWAYS             (1<<11)
+#define TRANSPORT_PUSH_CERT_IF_ASKED           (1<<12)
+#define TRANSPORT_PUSH_ATOMIC                  (1<<13)
+#define TRANSPORT_PUSH_OPTIONS                 (1<<14)
 
 extern int transport_summary_width(const struct ref *refs);