mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-07 12:50:54 +01:00
add logs
This commit is contained in:
@@ -3,6 +3,8 @@ package sonia.scm.it;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.io.Files;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import sonia.scm.repository.Changeset;
|
||||
import sonia.scm.repository.Person;
|
||||
import sonia.scm.repository.client.api.ClientCommand;
|
||||
@@ -15,6 +17,8 @@ import java.util.UUID;
|
||||
|
||||
public class RepositoryUtil {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(RepositoryUtil.class);
|
||||
|
||||
private static final RepositoryClientFactory REPOSITORY_CLIENT_FACTORY = new RepositoryClientFactory();
|
||||
|
||||
static RepositoryClient createRepositoryClient(String repositoryType, File folder) throws IOException {
|
||||
@@ -58,6 +62,7 @@ public class RepositoryUtil {
|
||||
}
|
||||
|
||||
static Changeset commit(RepositoryClient repositoryClient, String username, String message) throws IOException {
|
||||
LOG.info("user: {} try to commit with message: {}", username, message);
|
||||
Changeset changeset = repositoryClient.getCommitCommand().commit(new Person(username, username + "@scm-manager.org"), message);
|
||||
if (repositoryClient.isCommandSupported(ClientCommand.PUSH)) {
|
||||
repositoryClient.getPushCommand().push();
|
||||
|
||||
Reference in New Issue
Block a user