@Override public void unlock() { cachedSupplier.get().unlock(); }
private void cherryPick(final JGitPathImpl source, final JGitPathImpl target, final String... commits) { try { target.getFileSystem().lock(); source.getFileSystem().getGit().cherryPick(target, commits); } finally { target.getFileSystem().unlock(); } }
private void merge(final JGitPathImpl source, final JGitPathImpl target) { try { target.getFileSystem().lock(); source.getFileSystem().getGit().merge(source.getRefTree(), target.getRefTree()); } finally { target.getFileSystem().unlock(); } }
private void createBranch(final JGitPathImpl source, final JGitPathImpl target) { try { target.getFileSystem().lock(); source.getFileSystem().getGit().createRef(source.getRefTree(), target.getRefTree()); } finally { target.getFileSystem().unlock(); } }
fileSystem.getGit().syncRemote(remote); } finally { fileSystem.unlock();
public void deleteBranch(final JGitPathImpl path) { final Ref branch = path.getFileSystem().getGit().getRef(path.getRefTree()); if (branch == null) { throw new NoSuchFileException(path.toString()); } try { path.getFileSystem().lock(); path.getFileSystem().getGit().deleteRef(branch); } finally { path.getFileSystem().unlock(); } }
private void lockAndSquash(final Path path, final SquashOption value) { final JGitFileSystem fileSystem = (JGitFileSystem) path.getFileSystem(); try { fileSystem.lock(); final JGitPathImpl gSource = toPathImpl(path); String commitMessage = checkNotEmpty("commitMessage", value.getMessage()); String startCommit = checkNotEmpty("startCommit", value.getRecord().id()); gSource.getFileSystem().getGit().squash(gSource.getRefTree(), startCommit, commitMessage); } finally { fileSystem.unlock(); } }
} catch (Exception e) { fs.lock(); fs.unlock();
} catch (Exception e) { fs.lock(); fs.unlock();
fileSystem.unlock();