git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [JGIT PATCH 3/4] Added test for RefUpdate branch deletion

From
Shawn O. Pearce <spearce@spearce.org>
Date
Aug 22, 2008, 23:26 UTC
Message-ID
<20080822232618.GQ3483@spearce.org>
In-Reply-To
<1219445147-6801-4-git-send-email-charleso@charleso.org>
Charles O'Farrell <charleso@charleso.org> wrote:
Show 7 quoted lines
> +public class RefUpdateTest extends RepositoryTestCase {
> +
> +	public void testDeleteHead() throws IOException {
> +		final RefUpdate ref = updateRef(Constants.HEAD);
> +		delete(ref, Result.NOT_ATTEMPTED, true, false);
> +	}
> +}
So I see you didn't run the unit tests before emailing.  ;-)
I squashed this into the patch I am replying to:
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java
index 62a60c3..1ade2ef 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java
@@ -72,7 +72,7 @@ public void testLooseDelete() throws IOException {
 
 	public void testDeleteHead() throws IOException {
 		final RefUpdate ref = updateRef(Constants.HEAD);
-		delete(ref, Result.NOT_ATTEMPTED, true, false);
+		delete(ref, Result.REJECTED_CURRENT_BRANCH, true, false);
 	}
 
 	public void testLogDeleted() throws IOException {

Otherwise the series looks good.  Compiles.  Passes tests.
Tests look correct.  Thanks!
-- 
Shawn.
Previous: Charles O'FarrellNext: Robin Rosenberg
Message 6 of 9 in “Branch deletion testing and bug fixes”
  1. 0/4 Branch deletion testing and bug fixesCharles O'Farrell, Aug 22, 2008
  2. 1/4 Ensured that RefUpdate cannot delete current branchCharles O'Farrell, Aug 22, 2008
  3. 2/4 Fixed bug where RefUpdate didn't delete identical HEAD branchCharles O'Farrell, Aug 22, 2008
  4. 3/4 Added test for RefUpdate branch deletionCharles O'Farrell, Aug 22, 2008
  5. 4/4 Added extra javadoc for delete to significant RefUpdate resultsCharles O'Farrell, Aug 22, 2008
  6. Shawn O. PearceAug 22, 2008
  7. Robin RosenbergAug 22, 2008
  8. Shawn O. PearceAug 22, 2008
  9. Shawn O. PearceAug 22, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.