|
|
|
@ -18,6 +18,7 @@ import org.eclipse.jgit.api.Git;
@@ -18,6 +18,7 @@ import org.eclipse.jgit.api.Git;
|
|
|
|
|
import org.eclipse.jgit.api.GitCommand; |
|
|
|
|
import org.eclipse.jgit.events.RepositoryListener; |
|
|
|
|
import org.eclipse.jgit.lib.Repository; |
|
|
|
|
import org.eclipse.jgit.storage.file.FileRepositoryBuilder; |
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.exc.StreamReadException; |
|
|
|
|
import com.fasterxml.jackson.databind.DatabindException; |
|
|
|
@ -52,19 +53,23 @@ public class SourceListener {
@@ -52,19 +53,23 @@ public class SourceListener {
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public boolean isUpdated(){ |
|
|
|
|
//
|
|
|
|
|
//Repository repository = Git.lsRemoteRepository().setRemote(opt.getLinkVC()).getRepository();
|
|
|
|
|
//git remote add <remote_name> <remote_uri>
|
|
|
|
|
//Git.lsRemoteRepository()
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
System.out.println(Git.lsRemoteRepository().); |
|
|
|
|
Repository rep = openJGitCookbookRepository(); |
|
|
|
|
System.out.println(">>" + rep.getIdentifier()); |
|
|
|
|
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
System.out.println(e.getMessage()); |
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
public static Repository openJGitCookbookRepository() throws IOException { |
|
|
|
|
FileRepositoryBuilder builder = new FileRepositoryBuilder(); |
|
|
|
|
return builder |
|
|
|
|
.readEnvironment() // scan environment GIT_* variables
|
|
|
|
|
.findGitDir() // scan up the file system tree
|
|
|
|
|
.build(); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* Извлечение данных из options.json |
|
|
|
|
* @return |
|
|
|
|