From f514ae61cc11daebd92e23b0a6b7b6a6bbc3d96d Mon Sep 17 00:00:00 2001 From: esoe Date: Thu, 10 Nov 2022 19:30:54 +0300 Subject: [PATCH] qq --- .../sourceListener/ListRemoteRepository.java | 6 +++--- .../sourceListener/SourceListener.java | 19 +++++++++++------- .../sourceListener/ListRemoteRepository.class | Bin 2794 -> 3007 bytes .../sourceListener/SourceListener.class | Bin 6108 -> 6661 bytes 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/main/java/ru/molokoin/sourceListener/ListRemoteRepository.java b/src/main/java/ru/molokoin/sourceListener/ListRemoteRepository.java index 03e1261..4a0b24c 100644 --- a/src/main/java/ru/molokoin/sourceListener/ListRemoteRepository.java +++ b/src/main/java/ru/molokoin/sourceListener/ListRemoteRepository.java @@ -32,7 +32,7 @@ public class ListRemoteRepository { public static void main(String[] args) throws GitAPIException { // then clone - System.out.println("Listing remote repository " + REMOTE_URL); + System.out.println("Listing remote repository: " + REMOTE_URL); Collection refs = Git.lsRemoteRepository() .setHeads(true) .setTags(true) @@ -40,7 +40,7 @@ public class ListRemoteRepository { .call(); for (Ref ref : refs) { - System.out.println("Ref: " + ref); + System.out.println("Ref>>>>>>>>: " + ref); } final Map map = Git.lsRemoteRepository() @@ -60,7 +60,7 @@ public class ListRemoteRepository { System.out.println("All refs"); for (Ref ref : refs) { - System.out.println("Ref: " + ref); + System.out.println(">>>>>Ref: " + ref.getStorage().name() + ">>>>>" + ref.getName()); } } } \ No newline at end of file diff --git a/src/main/java/ru/molokoin/sourceListener/SourceListener.java b/src/main/java/ru/molokoin/sourceListener/SourceListener.java index 32a9e40..e6b3e55 100644 --- a/src/main/java/ru/molokoin/sourceListener/SourceListener.java +++ b/src/main/java/ru/molokoin/sourceListener/SourceListener.java @@ -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 { * @return */ public boolean isUpdated(){ - // - //Repository repository = Git.lsRemoteRepository().setRemote(opt.getLinkVC()).getRepository(); - //git remote add - //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 diff --git a/target/classes/ru/molokoin/sourceListener/ListRemoteRepository.class b/target/classes/ru/molokoin/sourceListener/ListRemoteRepository.class index 69d433145c21b02beaf41b703936a69de9811d1c..db80c91456d4178f1801e8b7fd921277c697b0d1 100644 GIT binary patch delta 493 zcmX|-OGs2v7{`C#ojdo;+$M1}QCFw5vs{RxR4MZThY=br$D*=lB2q|L<^q?cc2OxBqN>0#5Pft^ZY| z-Tsi2lMWVUjus9%x17Z8^ZA}kWffN4Z_*g!j^OVg)zZN(a@(c&e^I&$4q#o#p=J|NSefKGUv7yb=d-&lsK?oohG^ nbtO&^Efd4#GHhySQuhn>IIQwg&!kpYRDR{f^%Xf@XH$Ox@(OQm delta 314 zcmX|)yDtP`6vcnv>^yd+5{btq5|a>-wL&3u8$z=Ygha75t5Qf*8oTSUo{RN$O3^5p zWCRInJrR{kfj>cvyBSg4d(Sz)bMIR|n!LxKn>%0#ec?SRmD6u3rTkj8FGw59hH1?d z7J_s0Sp^-=s!}C=njF?&$t5?9i3Q5h1@|@6nKG{#RXmWJyrlJ(@qFXN6;r(-(;>4V zem#&^oJ23W?5z~}CaY{lXprYw?0OSLN^-UFNtrbi{WP=A1_pDSu}MX?3K_Q8Cc*ok z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