Skip to content

Commit ed96a9c

Browse files
committed
Create annotated release tags by default
1 parent 65c8dec commit ed96a9c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/kmono-git/src/k16/kmono/git/tags.clj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,19 @@
7474
the specified `ref` (default: HEAD)."
7575
{:malli/schema [:-> :string [:map
7676
[:ref {:optional true} :string]
77+
[:annotated {:optional true
78+
:default true} :boolean]
7779
[:tags [:sequential :string]]]
7880
:nil]}
79-
[^String repo-root {:keys [ref tags]}]
81+
[^String repo-root {:keys [ref annotated tags]}]
8082
(with-open [git (Git/open (File. repo-root))]
8183
(let [repo (Git/.getRepository git)
8284
obj (resolve-object repo ref)]
8385
(doseq [tag tags]
8486
(let [cmd (Git/.tag git)]
8587
(TagCommand/.setName cmd tag)
8688
(TagCommand/.setObjectId cmd obj)
87-
(TagCommand/.setAnnotated cmd false)
89+
(TagCommand/.setAnnotated cmd (if (boolean? annotated)
90+
annotated
91+
true))
8892
(TagCommand/.call cmd))))))

packages/kmono-git/test/k16/kmono/git/tag_test.clj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
(commit *repo* "change-1")
2222

2323
(git.tags/create-tags *repo* {:ref (git.commit/get-current-commit *repo*)
24+
:annotated false
2425
:tags ["b-1"]})
2526

2627
(proc/shell {:dir (str *repo*)

0 commit comments

Comments
 (0)