mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 19:45:51 +01:00
improve git repository creation
This commit is contained in:
@@ -86,18 +86,11 @@ public class GitRepositoryHandler
|
|||||||
"update-server-info");
|
"update-server-info");
|
||||||
|
|
||||||
command.setWorkDirectory(directory);
|
command.setWorkDirectory(directory);
|
||||||
|
execute(command);
|
||||||
CommandResult result = command.execute();
|
command = new ExtendedCommand(config.getGitBinary(), "config", "--bool",
|
||||||
|
"--add", "http.receivepack", "true");
|
||||||
if (!result.isSuccessfull())
|
command.setWorkDirectory(directory);
|
||||||
{
|
execute(command);
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
@@ -113,4 +106,31 @@ public class GitRepositoryHandler
|
|||||||
{
|
{
|
||||||
return GitConfig.class;
|
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