@Test
public void testCloneAndBranchLauncher() throws Throwable {

    testdir.ensureEmpty();

    GitMirrors mirrors = GitMirrors.load();
    GitFactory.setMirrors(mirrors);

    WorkDir workdir = new WorkDir(testdir.getFile("work"));

    Repo repo = new Repo();
    repo.setUrl("git://android.git.kernel.org/platform/packages/apps/Launcher.git");
    String branchName = "android-sdk-2.0.1_r1";

    IGit git = workdir.getGitRepo(repo.getUrl());

    GitCloneTask gitclone = new GitCloneTask(git, repo.getUrl());
    GitSwitchBranchTask gitbranch = new GitSwitchBranchTask(git, branchName);

    TaskQueue tasks = new TaskQueue();

    gitclone.run(tasks);
    gitbranch.run(tasks);

    Assert.assertThat("Branch name", git.getCurrentBranch(), is("refs/tags/" + branchName));
}