|
|
@ -34,7 +34,7 @@ public class GitServiceImpl implements GitService { |
|
|
|
private String uriGit; |
|
|
|
private String uriGit; |
|
|
|
private static final String NAME_URI = "origin"; |
|
|
|
private static final String NAME_URI = "origin"; |
|
|
|
private static final String COMMIT_MESSAGE = "commited"; |
|
|
|
private static final String COMMIT_MESSAGE = "commited"; |
|
|
|
|
|
|
|
private static final String BRANCH_NAME = "main"; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void pushToGit() throws IOException, GitAPIException, URISyntaxException { |
|
|
|
public void pushToGit() throws IOException, GitAPIException, URISyntaxException { |
|
|
@ -63,7 +63,7 @@ public class GitServiceImpl implements GitService { |
|
|
|
public void pullFromGit() throws IOException, GitAPIException { |
|
|
|
public void pullFromGit() throws IOException, GitAPIException { |
|
|
|
log.debug("Starting pullFromGit method."); |
|
|
|
log.debug("Starting pullFromGit method."); |
|
|
|
try (Git git = Git.open(new File(tempDirectoryPath))){ |
|
|
|
try (Git git = Git.open(new File(tempDirectoryPath))){ |
|
|
|
git.pull().setCredentialsProvider(createCredential()).setRemote("origin").setRemoteBranchName("main").call(); |
|
|
|
git.pull().setCredentialsProvider(createCredential()).setRemote(NAME_URI).setRemoteBranchName(BRANCH_NAME).call(); |
|
|
|
log.info("Pull from Git successful."); |
|
|
|
log.info("Pull from Git successful."); |
|
|
|
} catch (IOException|GitAPIException exception){ |
|
|
|
} catch (IOException|GitAPIException exception){ |
|
|
|
log.error("Error push from git", exception); |
|
|
|
log.error("Error push from git", exception); |
|
|
|