mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-03 12:05:52 +01:00
Document SimpleGitWorkingCopyFactory
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -39,12 +39,13 @@ import sonia.scm.repository.Repository;
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public class GitContext implements Closeable
|
||||
public class GitContext implements Closeable, Supplier<Repository>
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -108,6 +109,11 @@ public class GitContext implements Closeable
|
||||
return repository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Repository get() {
|
||||
return getRepository();
|
||||
}
|
||||
|
||||
File getDirectory() {
|
||||
return directory;
|
||||
}
|
||||
|
||||
@@ -133,14 +133,9 @@ public class SimpleGitWorkingCopyFactory extends SimpleWorkingCopyFactory<Reposi
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void closeWorkingCopyInternal(Repository workingCopy) throws Exception {
|
||||
protected void closeWorkingCopy(Repository workingCopy) throws Exception {
|
||||
if (workingCopy != null) {
|
||||
workingCopy.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected sonia.scm.repository.Repository getScmRepository(GitContext context) {
|
||||
return context.getRepository();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user