Skip to content

Commit 6bc3c8c

Browse files
committed
[issue #4] Ignore newline from git --format's output
1 parent 8c9d7f8 commit 6bc3c8c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

  • src
    • main/clojure/buildversion_plugin
    • test/clojure/buildversion_plugin/test

src/main/clojure/buildversion_plugin/git.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
[short-hash long-hash] (split
7272
(run-git-wait dir
7373
["log" "-n" "1" "--format=%h %H"])
74-
#" ")
74+
#"\s+")
7575

7676
versioning-properties {:build-tag "N/A"
7777
:build-version "N/A"

src/test/clojure/buildversion_plugin/test/git.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
(is checkout-OK (str "Checkout failure " (checkout :err) ))
6464

65-
(doall (map (fn [key] (is (re-find (expected-patterns key) (actual-versions key))
65+
(doall (map (fn [key] (is (re-matches (expected-patterns key) (actual-versions key))
6666
(str "Testing " key " for commit '" commit-descr "'")))
6767
(keys expected-patterns)))))
6868

@@ -94,7 +94,7 @@
9494
})
9595

9696
(assert-for-commit "dev commit 5"
97-
{:build-version #"1.1.0-SNAPSHOT-3"
97+
{:build-version #"1.1.0-SNAPSHOT-3.*"
9898
:build-tag #"^1.1.0-SNAPSHOT$"
9999
:build-tag-delta #"3"
100100
:build-tstamp #"\d+"

0 commit comments

Comments
 (0)