Commit and push changes

This commit is contained in:
René Pfeuffer
2019-08-28 16:23:33 +02:00
parent 406620bd9d
commit aae9ba6a59
2 changed files with 85 additions and 5 deletions

View File

@@ -64,7 +64,9 @@ public class GitModifyCommand extends AbstractGitCommand implements ModifyComman
for (ModifyCommandRequest.PartialRequest r: request.getRequests()) {
r.execute(this);
}
return null;
doCommit();
push();
return clone.getRepository().getRefDatabase().findRef("HEAD").getObjectId().name();
}
@Override
@@ -165,6 +167,16 @@ public class GitModifyCommand extends AbstractGitCommand implements ModifyComman
return request.getAuthor();
}
}
private void push() {
try {
clone.push().call();
} catch (GitAPIException e) {
throw new IntegrateChangesFromWorkdirException(repository,
"could not push modified branch " + request.getBranch() + " into central repository", e);
}
LOG.debug("pushed modified branch {}", request.getBranch());
}
}
private String throwInternalRepositoryException(String message, Exception e) {