@Test public void testCheckoutHard() throws IOException { remoteGitHelper.checkoutHard(connection, "remote-path", "abc123"); verify(connection).executeIn("remote-path", "git", "checkout", "-f", "abc123"); verify(connection).executeIn("remote-path", "git", "clean", "-fd"); verify(connection).executeIn("remote-path", "git", "reset", "--hard"); }
public void checkoutHard(SshConnection connection, String remotePath, String revision) throws IOException { connection.executeIn(remotePath, "git", "checkout", "-f", revision); connection.executeIn(remotePath, "git", "reset", "--hard"); connection.executeIn(remotePath, "git", "clean", "-fd"); }
RemoteGitHelper { public void checkoutHard(SshConnection connection, String remotePath, String revision) throws IOException { connection.executeIn(remotePath, "git", "checkout", "-f", revision); connection.executeIn(remotePath, "git", "reset", "--hard"); connection.executeIn(remotePath, "git", "clean", "-fd"); } }
RemoteGitHelper { public void checkoutHard(SshConnection connection, String remotePath, String revision) throws IOException { connection.executeIn(remotePath, "git", "checkout", "-f", revision); connection.executeIn(remotePath, "git", "reset", "--hard"); connection.executeIn(remotePath, "git", "clean", "-fd"); } protected  RemoteGitHelper(); }
RemoteGitHelper { public void checkoutHard(SshConnection connection, String remotePath, String revision) throws IOException { connection.executeIn(remotePath, "git", "checkout", "-f", revision); connection.executeIn(remotePath, "git", "reset", "--hard"); connection.executeIn(remotePath, "git", "clean", "-fd"); } protected  RemoteGitHelper(); void installGit(SshConnection connection, SystemSpecification os); boolean isGitInstalled(SshConnection connection); void checkoutHard(SshConnection connection, String remotePath, String revision); void initEmptyRepository(SshConnection connection, String remotePath); }
RemoteGitHelper { public void checkoutHard(SshConnection connection, String remotePath, String revision) throws IOException { connection.executeIn(remotePath, "git", "checkout", "-f", revision); connection.executeIn(remotePath, "git", "reset", "--hard"); connection.executeIn(remotePath, "git", "clean", "-fd"); } protected  RemoteGitHelper(); void installGit(SshConnection connection, SystemSpecification os); boolean isGitInstalled(SshConnection connection); void checkoutHard(SshConnection connection, String remotePath, String revision); void initEmptyRepository(SshConnection connection, String remotePath);  }