javatests/com/google/gitiles/BranchRedirectTest.java [222:237]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void diff_withGrandParent_redirect() throws Exception {
    RevCommit parent1 = repo.branch(MASTER).commit().add("foo", "contents").create();
    RevCommit parent2 =
        repo.branch(MASTER).commit().add("bar", "contents").parent(parent1).create();
    RevCommit master = repo.branch(MASTER).commit().add("bar", "contents").parent(parent2).create();
    repo.branch(MAIN).commit().parent(master).create();

    String path = "/repo/+diff/refs/heads/master^^..refs/heads/master";
    FakeHttpServletRequest req = newHttpRequest(path, ORIGIN, QUERY_STRING_HTML);
    FakeHttpServletResponse res = new FakeHttpServletResponse();

    servlet.service(req, res);
    assertThat(res.getStatus()).isEqualTo(SC_OK);
    assertThat(res.getActualBodyString())
        .contains("/b/repo/+/refs/heads/main%5E%5E..refs/heads/main/?format=html");
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



javatests/com/google/gitiles/BranchRedirectTest.java [257:272]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void diff_withRelativeGrandParent_redirect() throws Exception {
    RevCommit parent1 = repo.branch(MASTER).commit().add("foo", "contents").create();
    RevCommit parent2 =
        repo.branch(MASTER).commit().add("bar", "contents").parent(parent1).create();
    RevCommit master = repo.branch(MASTER).commit().add("bar", "contents").parent(parent2).create();
    repo.branch(MAIN).commit().parent(master).create();

    String path = "/repo/+diff/refs/heads/master~2..refs/heads/master";
    FakeHttpServletRequest req = newHttpRequest(path, ORIGIN, QUERY_STRING_HTML);
    FakeHttpServletResponse res = new FakeHttpServletResponse();

    servlet.service(req, res);
    assertThat(res.getStatus()).isEqualTo(SC_OK);
    assertThat(res.getActualBodyString())
        .contains("/b/repo/+/refs/heads/main%7E2..refs/heads/main/?format=html");
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



