rename got.conf(5) mirror-references to mirror_references for consistency Existing configuration files will keep working for now since the old name with dashes is still recognized by the config parser.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
diff --git a/got/got.c b/got/got.c
index 75efd58..78d2132 100644
--- a/got/got.c
+++ b/got/got.c
@@ -1344,7 +1344,7 @@ create_gotconfig(const char *proto, const char *host, const char *port,
remote_repo_path, branches ? "\tbranch { " : "",
branches ? branches : "", branches ? "}\n" : "",
refs ? "\treference { " : "", refs ? refs : "", refs ? "}\n" : "",
- mirror_references ? "\tmirror-references yes\n" : "",
+ mirror_references ? "\tmirror_references yes\n" : "",
fetch_all_branches ? "\tfetch_all_branches yes\n" : "") == -1) {
err = got_error_from_errno("asprintf");
goto done;
diff --git a/got/got.conf.5 b/got/got.conf.5
index d529aa6..5827c26 100644
--- a/got/got.conf.5
+++ b/got/got.conf.5
@@ -151,7 +151,7 @@ In any case, references in the
.Dq refs/tags/
namespace will always be fetched and mapped directly to local references
in the same namespace.
-.It Ic mirror-references Ar yes | no
+.It Ic mirror_references Ar yes | no
This option controls the behaviour of
.Cm got fetch
when updating references.
@@ -239,7 +239,7 @@ remote "origin" {
repository "openbsd/src"
server git@github.com
protocol git+ssh
- mirror-references yes
+ mirror_references yes
}
.Ed
.Pp
diff --git a/libexec/got-read-gotconfig/parse.y b/libexec/got-read-gotconfig/parse.y
index 61a08c3..75ffe68 100644
--- a/libexec/got-read-gotconfig/parse.y
+++ b/libexec/got-read-gotconfig/parse.y
@@ -370,7 +370,8 @@ lookup(char *s)
{"fetch", FETCH},
{"fetch-all-branches", FETCH_ALL_BRANCHES}, /* deprecated */
{"fetch_all_branches", FETCH_ALL_BRANCHES},
- {"mirror-references", MIRROR_REFERENCES},
+ {"mirror-references", MIRROR_REFERENCES}, /* deprecated */
+ {"mirror_references", MIRROR_REFERENCES},
{"port", PORT},
{"protocol", PROTOCOL},
{"reference", REFERENCE},
diff --git a/regress/cmdline/clone.sh b/regress/cmdline/clone.sh
index 192edf2..35d7c0b 100755
--- a/regress/cmdline/clone.sh
+++ b/regress/cmdline/clone.sh
@@ -349,7 +349,7 @@ remote "origin" {
protocol ssh
repository "$testroot/repo"
branch { "master" }
- mirror-references yes
+ mirror_references yes
}
EOF
cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
@@ -421,7 +421,7 @@ remote "origin" {
server 127.0.0.1
protocol ssh
repository "$testroot/repo"
- mirror-references yes
+ mirror_references yes
fetch_all_branches yes
}
EOF
@@ -649,7 +649,7 @@ remote "origin" {
repository "$testroot/repo"
branch { "master" }
reference { "hoo" }
- mirror-references yes
+ mirror_references yes
}
EOF
cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected