tools.gitlibs
cannot fetch Git SHA1s that aren't included on a branch. For example, if a commit is only referenced by a tag (e.g., v1.2.3-acme1), then clj -Spath
fails with the following error:
Error building classpath. Missing unknown fb8143248fddb5177de6eb55ed21956782776c4a
org.eclipse.jgit.api.errors.JGitInternalException: Missing unknown fb8143248fddb5177de6eb55ed21956782776c4a
Would it be possible to update tools.gitlibs with the following patch?
---
src/main/clojure/clojure/tools/gitlibs/impl.clj | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/main/clojure/clojure/tools/gitlibs/impl.clj b/src/main/clojure/clojure/tools/gitlibs/impl.clj
index b2eba18..a2ee828 100644
--- a/src/main/clojure/clojure/tools/gitlibs/impl.clj
+++ b/src/main/clojure/clojure/tools/gitlibs/impl.clj
@@ -17,7 +17,7 @@
[org.eclipse.jgit.api Git GitCommand TransportCommand TransportConfigCallback]
[org.eclipse.jgit.lib Repository RepositoryBuilder]
[org.eclipse.jgit.revwalk RevWalk RevCommit]
- [org.eclipse.jgit.transport SshTransport JschConfigSessionFactory]
+ [org.eclipse.jgit.transport SshTransport JschConfigSessionFactory TagOpt]
[com.jcraft.jsch JSch]
[com.jcraft.jsch.agentproxy Connector ConnectorFactory RemoteIdentityRepository]))
@@ -63,7 +63,7 @@
(defn git-fetch
^Git [git-dir]
(let [git (Git. (git-repo git-dir))]
- (call-with-auth (.. git fetch))
+ (call-with-auth (.. git fetch (setTagOpt TagOpt/FETCH_TAGS)))
git))
;; TODO: restrict clone to an optional refspec?
@@ -74,7 +74,8 @@
(.. (Git/cloneRepository) (setURI url) (setGitDir (jio/file git-dir))
(setBare true)
(setNoCheckout true)
- (setCloneAllBranches true)))
+ (setCloneAllBranches true)
+ (setTagOption TagOpt/FETCH_TAGS)))
git-dir)