![JAR search and dependency download from the Maven repository](/logo.png)
org.koshinuke.jgit.GGitUtil.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yuzen Show documentation
Show all versions of yuzen Show documentation
static contents granerator
The newest version!
package org.koshinuke.jgit
import javax.annotation.Nonnull
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.lib.Repository
import org.koshinuke.util.LifecycleFunctions
/**
* @author taichi
*/
class GGitUtil {
public static R handle(@Nonnull Git git, @Nonnull Closure closure) {
Objects.requireNonNull(git)
return handle(git.getRepository(), closure)
}
public static R handle(@Nonnull Repository repo, @Nonnull Closure closure) {
Objects.requireNonNull(repo)
return LifecycleFunctions.handle({repo}, {it.close()}, closure)
}
public static R lockDirCache(@Nonnull Repository repo, @Nonnull Closure closure) {
Objects.requireNonNull(repo)
return LifecycleFunctions.handle({ repo.lockDirCache() }, { it.unlock() }, closure)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy