Exemple #1
0
  public void setup() throws Exception {
    project = new ProjectAlpha("projectAlpha");
    releases = new ProjectBetaReleases("projectBeta-releases");

    // create one branch off of master; add a library only on the branch
    WithCwd wd = new WithCwd(project.getRepo().getWorkTree());
    {
      // add a library on the branch.
      git.args("checkout", "-b", "blue").start().get();
      assertJoy(
          Mdm.run(
              "add", releases.getRepo().getWorkTree().toString(), "--version=v1.0", "--name=beta"));

      // switch back to master
      git.args("checkout", "master").start().get();

      // make one more commit just so it's not a degenerate fast-forward merge this direction
      IOForge.saveFile("asdf", new File("somefile").getCanonicalFile());
      git.args("add", "--", "somefile").start().get();
      git.args("commit", "-m", "somecommit").start().get();

      // remove the library from the working tree.
      // this is a cheap way to force any mdm-update invocations to take the long road through
      // fetch.
      IOForge.delete(new File("lib").getCanonicalFile());
    }
    wd.close();
  }