mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
WIP
This commit is contained in:
parent
5fd3a88b38
commit
81dc92f449
|
@ -9,9 +9,14 @@ public class ActionRepoImpl implements ActionRepo{
|
|||
|
||||
Repository repository;
|
||||
|
||||
Git git;
|
||||
|
||||
// Internal method
|
||||
private Git getGit() {
|
||||
return new Git(repository);
|
||||
if (this.git == null) {
|
||||
this.git = new Git(repository);
|
||||
}
|
||||
return this.git;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -34,7 +39,7 @@ public class ActionRepoImpl implements ActionRepo{
|
|||
|
||||
@Override
|
||||
public String[] getUnstagedFiles() {
|
||||
Git git = new Git(repository);
|
||||
Git git = getGit();
|
||||
try {
|
||||
return git.status().call().getUntracked().toArray(new String[0]);
|
||||
} catch (Exception e) { // TODO-rca: エラーハンドリング
|
||||
|
@ -44,7 +49,7 @@ public class ActionRepoImpl implements ActionRepo{
|
|||
|
||||
@Override
|
||||
public String[] getStagedFiles() {
|
||||
Git git = new Git(repository);
|
||||
Git git = getGit();
|
||||
try {
|
||||
return git.status().call().getAdded().toArray(new String[0]);
|
||||
} catch (Exception e) { // TODO-rca: エラーハンドリング
|
||||
|
|
Loading…
Reference in New Issue
Block a user