mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-10-26 08:06:09 +01:00
improve git repository creation
This commit is contained in:
@@ -86,18 +86,11 @@ public class GitRepositoryHandler
|
||||
"update-server-info");
|
||||
|
||||
command.setWorkDirectory(directory);
|
||||
|
||||
CommandResult result = command.execute();
|
||||
|
||||
if (!result.isSuccessfull())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder("command exit with error ");
|
||||
|
||||
msg.append(result.getReturnCode()).append(" and message: '");
|
||||
msg.append(result.getOutput()).append("'");
|
||||
|
||||
throw new RepositoryException(msg.toString());
|
||||
}
|
||||
execute(command);
|
||||
command = new ExtendedCommand(config.getGitBinary(), "config", "--bool",
|
||||
"--add", "http.receivepack", "true");
|
||||
command.setWorkDirectory(directory);
|
||||
execute(command);
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
@@ -113,4 +106,31 @@ public class GitRepositoryHandler
|
||||
{
|
||||
return GitConfig.class;
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param command
|
||||
*
|
||||
* @throws IOException
|
||||
* @throws RepositoryException
|
||||
*/
|
||||
private void execute(ExtendedCommand command)
|
||||
throws IOException, RepositoryException
|
||||
{
|
||||
CommandResult result = command.execute();
|
||||
|
||||
if (!result.isSuccessfull())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder("command exit with error ");
|
||||
|
||||
msg.append(result.getReturnCode()).append(" and message: '");
|
||||
msg.append(result.getOutput()).append("'");
|
||||
|
||||
throw new RepositoryException(msg.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user