use of jetbrains.buildServer.buildTriggers.vcs.git.agent.AgentGitCommandLine in project teamcity-git by JetBrains.
the class FetchCommandImplTest method should_throw_special_exception_when_stderr_mentions_broken_index.
@TestFor(issues = "TW-18853")
public void should_throw_special_exception_when_stderr_mentions_broken_index() throws VcsException {
AgentGitCommandLine failedCmd = new AgentGitCommandLine(null, getFakeGen(), new StubContext()) {
@Override
public ExecResult run(@NotNull GitCommandSettings settings) throws VcsException {
throw new VcsException("fatal: index file smaller than expected");
}
};
FetchCommand fetch = new FetchCommandImpl(failedCmd).setRefspec("+refs/heads/*:refs/remotes/origin/*").setTimeout(3600).setAuthSettings(getEmptyAuthSettings());
try {
fetch.call();
} catch (GitIndexCorruptedException e) {
// expected
} catch (VcsException e) {
fail("GitIndexCorruptedException should be thrown");
}
}
Aggregations