如何使用 Grgit 从远程获取?

How to use Grgit to fetch from remote?

以下代码:

final git = Grgit.open("${oldVersionRoot}/.git")
git.fetch(refSpecs: ["release/${oldVersion}"])

发出:

Caused by: org.eclipse.jgit.errors.TransportException: Remote does not have release/2.1747.0 available for fetch.

fetch 工作的正确咒语是什么?

来自https://github.com/ajoberstar/gradle-git/issues/166

https://github.com/ajoberstar/grgit/blob/master/src/test/groovy/org/ajoberstar/grgit/operation/FetchOpSpec.groovy#L115表示使用:

git.fetch(refSpecs: ["refs/remotes/origin/release/${oldVersion}"])