mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
Put repository in git context to create proper exceptions
This commit is contained in:
@@ -65,7 +65,7 @@ public class AbstractGitCommandTestBase extends ZippedRepositoryTestBase
|
||||
{
|
||||
if (context == null)
|
||||
{
|
||||
context = new GitContext(repositoryDirectory);
|
||||
context = new GitContext(repositoryDirectory, repository);
|
||||
}
|
||||
|
||||
return context;
|
||||
|
||||
@@ -105,7 +105,7 @@ public class GitIncomingCommandTest
|
||||
|
||||
commit(outgoing, "added a");
|
||||
|
||||
GitPullCommand pull = new GitPullCommand(handler, new GitContext(incomingDirectory), incomingRepository);
|
||||
GitPullCommand pull = new GitPullCommand(handler, new GitContext(incomingDirectory, null), incomingRepository);
|
||||
PullCommandRequest req = new PullCommandRequest();
|
||||
req.setRemoteRepository(outgoingRepository);
|
||||
pull.pull(req);
|
||||
@@ -191,7 +191,7 @@ public class GitIncomingCommandTest
|
||||
*/
|
||||
private GitIncomingCommand createCommand()
|
||||
{
|
||||
return new GitIncomingCommand(handler, new GitContext(incomingDirectory),
|
||||
return new GitIncomingCommand(handler, new GitContext(incomingDirectory, null),
|
||||
incomingRepository);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ public class GitModificationsCommandTest extends AbstractRemoteCommandTestBase {
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
incomingModificationsCommand = new GitModificationsCommand(new GitContext(incomingDirectory), incomingRepository);
|
||||
outgoingModificationsCommand = new GitModificationsCommand(new GitContext(outgoingDirectory), outgoingRepository);
|
||||
incomingModificationsCommand = new GitModificationsCommand(new GitContext(incomingDirectory, null), incomingRepository);
|
||||
outgoingModificationsCommand = new GitModificationsCommand(new GitContext(outgoingDirectory, null), outgoingRepository);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -63,12 +63,12 @@ public class GitModificationsCommandTest extends AbstractRemoteCommandTestBase {
|
||||
}
|
||||
|
||||
void pushOutgoingAndPullIncoming() throws IOException {
|
||||
GitPushCommand cmd = new GitPushCommand(handler, new GitContext(outgoingDirectory),
|
||||
GitPushCommand cmd = new GitPushCommand(handler, new GitContext(outgoingDirectory, null),
|
||||
outgoingRepository);
|
||||
PushCommandRequest request = new PushCommandRequest();
|
||||
request.setRemoteRepository(incomingRepository);
|
||||
cmd.push(request);
|
||||
GitPullCommand pullCommand = new GitPullCommand(handler, new GitContext(incomingDirectory),
|
||||
GitPullCommand pullCommand = new GitPullCommand(handler, new GitContext(incomingDirectory, null),
|
||||
incomingRepository);
|
||||
PullCommandRequest pullRequest = new PullCommandRequest();
|
||||
pullRequest.setRemoteRepository(incomingRepository);
|
||||
|
||||
@@ -106,7 +106,7 @@ public class GitOutgoingCommandTest extends AbstractRemoteCommandTestBase
|
||||
commit(outgoing, "added a");
|
||||
|
||||
GitPushCommand push = new GitPushCommand(handler,
|
||||
new GitContext(outgoingDirectory),
|
||||
new GitContext(outgoingDirectory, null),
|
||||
outgoingRepository);
|
||||
PushCommandRequest req = new PushCommandRequest();
|
||||
|
||||
@@ -161,7 +161,7 @@ public class GitOutgoingCommandTest extends AbstractRemoteCommandTestBase
|
||||
*/
|
||||
private GitOutgoingCommand createCommand()
|
||||
{
|
||||
return new GitOutgoingCommand(handler, new GitContext(outgoingDirectory),
|
||||
return new GitOutgoingCommand(handler, new GitContext(outgoingDirectory, null),
|
||||
outgoingRepository);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ public class GitPushCommandTest extends AbstractRemoteCommandTestBase
|
||||
*/
|
||||
private GitPushCommand createCommand()
|
||||
{
|
||||
return new GitPushCommand(handler, new GitContext(outgoingDirectory),
|
||||
return new GitPushCommand(handler, new GitContext(outgoingDirectory, null),
|
||||
outgoingRepository);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user