mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Implemented bare repos. (resolved #5)
This commit is contained in:
parent
553a1064a5
commit
ece573c942
3 changed files with 12 additions and 1 deletions
|
@ -8,6 +8,7 @@ import org.eclipse.jgit.lib.Repository;
|
|||
import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;
|
||||
import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException;
|
||||
import uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.exception.InvalidProjectException;
|
||||
import uk.ac.ic.wlgitbridge.writelatex.filestore.store.WLFileStore;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
@ -53,6 +54,8 @@ public class WLBridgedProject {
|
|||
git.commit().setAuthor(new PersonIdent(contents.getUserName(), contents.getUserEmail(), contents.getWhen(), TimeZone.getDefault()))
|
||||
.setMessage(contents.getCommitMessage())
|
||||
.call();
|
||||
System.out.println(repository.getDirectory());
|
||||
WLFileStore.deleteInDirectoryApartFrom(contents.getDirectory(), ".git");
|
||||
}
|
||||
} catch (GitAPIException e) {
|
||||
throw new ServiceNotEnabledException();
|
||||
|
|
|
@ -2,6 +2,7 @@ package uk.ac.ic.wlgitbridge.bridge;
|
|||
|
||||
import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -12,6 +13,8 @@ public interface WritableRepositoryContents {
|
|||
|
||||
public void write() throws IOException, FailedConnectionException;
|
||||
|
||||
public File getDirectory();
|
||||
|
||||
public String getUserName();
|
||||
public String getUserEmail();
|
||||
public String getCommitMessage();
|
||||
|
|
|
@ -34,12 +34,17 @@ public class GitDirectoryContents implements WritableRepositoryContents {
|
|||
|
||||
@Override
|
||||
public void write() throws IOException, FailedConnectionException {
|
||||
WLFileStore.deleteInDirectoryApartFrom(gitDirectory, ".git", ".wlgb");
|
||||
WLFileStore.deleteInDirectoryApartFrom(gitDirectory, ".git");
|
||||
for (FileNode fileNode : fileNodes) {
|
||||
fileNode.writeToDisk(gitDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getDirectory() {
|
||||
return gitDirectory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
|
|
Loading…
Reference in a new issue