fast-export: use value from correct enum
ABORT and ERROR happen to have the same value, but come from differnt enums. Use the one from the correct enum, and while at it, rename the values to avoid such problems. Signed-off-by: Elijah Newren <newren@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Nov 15, 2018 at 23:59 UTC
b93b81e799ba6a59820821b4ea3afdec1970fbd6
1 file changed
+6
-6
builtin/fast-export.c
+6
-6
@@ -31,8 +31,8 @@ static const char *fast_export_usage[] = {
31
};
32
33
static int progress;
34
-static enum { ABORT, VERBATIM, WARN, WARN_STRIP, STRIP } signed_tag_mode = ABORT;
35
-static enum { ERROR, DROP, REWRITE } tag_of_filtered_mode = ERROR;
34
+static enum { SIGNED_TAG_ABORT, VERBATIM, WARN, WARN_STRIP, STRIP } signed_tag_mode = SIGNED_TAG_ABORT;
35
+static enum { TAG_FILTERING_ABORT, DROP, REWRITE } tag_of_filtered_mode = TAG_FILTERING_ABORT;
36
static int fake_missing_tagger;
37
static int use_done_feature;
38
static int no_data;
@@ -46,7 +46,7 @@ static int parse_opt_signed_tag_mode(const struct option *opt,
46
const char *arg, int unset)
47
{
48
if (unset || !strcmp(arg, "abort"))
49
- signed_tag_mode = ABORT;
49
+ signed_tag_mode = SIGNED_TAG_ABORT;
50
else if (!strcmp(arg, "verbatim") || !strcmp(arg, "ignore"))
51
signed_tag_mode = VERBATIM;
52
else if (!strcmp(arg, "warn"))
@@ -64,7 +64,7 @@ static int parse_opt_tag_of_filtered_mode(const struct option *opt,
64
const char *arg, int unset)
65
{
66
if (unset || !strcmp(arg, "abort"))
67
- tag_of_filtered_mode = ERROR;
67
+ tag_of_filtered_mode = TAG_FILTERING_ABORT;
68
else if (!strcmp(arg, "drop"))
69
tag_of_filtered_mode = DROP;
70
else if (!strcmp(arg, "rewrite"))
@@ -728,7 +728,7 @@ static void handle_tag(const char *name, struct tag *tag)
728
"\n-----BEGIN PGP SIGNATURE-----\n");
729
if (signature)
730
switch(signed_tag_mode) {
731
- case ABORT:
731
+ case SIGNED_TAG_ABORT:
732
die("encountered signed tag %s; use "
733
"--signed-tags=<mode> to handle it",
734
oid_to_hex(&tag->object.oid));
@@ -753,7 +753,7 @@ static void handle_tag(const char *name, struct tag *tag)
753
tagged_mark = get_object_mark(tagged);
754
if (!tagged_mark) {
755
switch(tag_of_filtered_mode) {
756
- case ABORT:
756
+ case TAG_FILTERING_ABORT:
757
die("tag %s tags unexported object; use "
758
"--tag-of-filtered-object=<mode> to handle it",
759
oid_to_hex(&tag->object.oid));