James Moger
2011-12-28 7f14da3aceae2db516a7bec2c2e00d48049ec7b5
tests/com/gitblit/tests/GitServletTest.java
@@ -83,7 +83,7 @@
         clone.call();
         cloned = true;
      } catch (Exception e) {
         e.printStackTrace();
         // swallow the exception which we expect
      }
      // restore anonymous repository access
@@ -97,12 +97,14 @@
   public void testAnonymousCommit() throws Exception {
      Git git = Git.open(folder);
      File file = new File(folder, "TODO");
      OutputStreamWriter os = new OutputStreamWriter(new FileOutputStream(file, true));
      BufferedWriter w = new BufferedWriter(os);
      w.write("// " + new Date().toString() + "\n");
      w.close();
      git.add().addFilepattern(file.getName()).call();
      git.commit().setMessage("test commit").call();
      for (int i = 0; i < 3; i++) {
         OutputStreamWriter os = new OutputStreamWriter(new FileOutputStream(file, true));
         BufferedWriter w = new BufferedWriter(os);
         w.write("// " + new Date().toString() + "\n");
         w.close();
         git.add().addFilepattern(file.getName()).call();
         git.commit().setMessage("test commit #" + (i + 1)).call();
      }
      git.push().setPushAll().call();
      git.getRepository().close();
   }