File tree 3 files changed +26
-1
lines changed
3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1
1
;; always force unix line endings to make hashing consistent
2
2
* text eol =lf
3
3
* .png binary
4
+ * .db binary
Original file line number Diff line number Diff line change 12
12
#_(shell-out-str " zonk" )
13
13
14
14
(defn ->github-project [remote-url]
15
- (second (re-find #"^git@github\. com:(.*)(\. git)?$" remote-url)))
15
+ (second (re-find #"^git@github\. com:(.*? )(\. git)?$" remote-url)))
16
16
17
17
(defn ->https-git-url
18
18
" Takes a git `remote-url` and tries to convert it into a https url for
Original file line number Diff line number Diff line change
1
+ (ns nextjournal.clerk.git-test
2
+ (:require [clojure.test :refer [deftest is testing]]
3
+ [nextjournal.clerk.git :as git]))
4
+
5
+ (deftest ->github-project
6
+ (testing " works with .git suffix"
7
+ (is (= " nextjournal/clerk"
8
+ (
git/->github-project " [email protected] :nextjournal/clerk.git" ))))
9
+ (testing " works without .git suffix"
10
+ (is (= " nextjournal/clerk"
11
+ (
git/->github-project " [email protected] :nextjournal/clerk" ))))
12
+ (testing " works only for github"
13
+ (
is (
nil? (
git/->github-project " [email protected] :other/host.git" )))))
14
+
15
+ (deftest ->https-git-url
16
+ (testing " works for https"
17
+ (is (= " https://github.com/nextjournal/clerk"
18
+ (git/->https-git-url " https://github.com/nextjournal/clerk.git" )))
19
+ (is (= " https://gitlab.com/other/host"
20
+ (git/->https-git-url " https://gitlab.com/other/host.git" ))))
21
+ (testing " rewrites github ssh to https"
22
+ (is (= " https://github.com/nextjournal/clerk"
23
+ (
git/->https-git-url " [email protected] :nextjournal/clerk.git" )))))
24
+
You can’t perform that action at this time.
0 commit comments