File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/main/clojure/clojure/tools/gitlibs Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
Changelog
2
2
===========
3
3
4
+ * next
5
+ * TDEPS-248 - Make ` tags ` return known tags when offline
4
6
* 2.5.190 on Feb 12, 2023
5
7
* Don't use future to background the process reading (leaves non-daemon thread)
6
8
* 2.5.186 on Feb 11, 2023
Original file line number Diff line number Diff line change 101
101
^File [url]
102
102
(jio/file (:gitlibs/dir @config/CONFIG) " _repos" (clean-url url)))
103
103
104
+ (defn git-try-fetch
105
+ " Try to fetch and return the error code (0=success)"
106
+ [^File git-dir]
107
+ (let [git-path (.getCanonicalPath git-dir)
108
+ ; ; NOTE: --prune-tags would be desirable here but was added in git 2.17.0
109
+ {:keys [exit]} (run-git " --git-dir" git-path
110
+ " fetch" " --quiet" " --all" " --tags" " --prune" )]
111
+ exit))
112
+
104
113
(defn git-fetch
105
114
[^File git-dir]
106
115
(let [git-path (.getCanonicalPath git-dir)
193
202
(defn tags
194
203
" Fetch, then return all tags in the git dir."
195
204
[git-dir]
196
- (git-fetch (jio/file git-dir))
205
+ (git-try- fetch (jio/file git-dir))
197
206
(let [{:keys [exit out err] :as ret} (run-git " --git-dir" git-dir " tag" " --sort=v:refname" )]
198
207
(when-not (zero? exit)
199
208
(throw (ex-info (format " Unable to get tags %s%n%s" git-dir err) ret)))
You can’t perform that action at this time.
0 commit comments