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

[JGIT PATCH 1/5] Sort Ref objects by OrigName and not Name

From
Shawn O. Pearce <spearce@spearce.org>
Date
Dec 23, 2008, 22:56 UTC
Message-ID
<1230073007-17337-2-git-send-email-spearce@spearce.org>
In-Reply-To
<1230073007-17337-1-git-send-email-spearce@spearce.org>

This avoids sorting symrefs by their target; instead we sort the symref by the symref's own name, thus placing "HEAD" before the standard "refs/heads/..." namespace.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 .../src/org/spearce/jgit/lib/RefComparator.java    |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RefComparator.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RefComparator.java
index 95e3e0f..940a7ec 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefComparator.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefComparator.java
@@ -54,7 +54,7 @@
 	public static final RefComparator INSTANCE = new RefComparator();
 
 	public int compare(final Ref o1, final Ref o2) {
-		return o1.getName().compareTo(o2.getName());
+		return o1.getOrigName().compareTo(o2.getOrigName());
 	}
 
 	/**
-- 
1.6.1.rc4.301.g5497a
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 2 of 6 in “Add "jgit upload-pack" for fetch service”
  1. 0/5 Add "jgit upload-pack" for fetch serviceShawn O. Pearce, Dec 23, 2008
  2. 1/5 Sort Ref objects by OrigName and not NameShawn O. Pearce, Dec 23, 2008
  3. 2/5 Permit subclass of ObjectId (e.g. RevObject) when calling PackWriterShawn O. Pearce, Dec 23, 2008
  4. 3/5 Implement "jgit upload-pack" to support fetching from jgitShawn O. Pearce, Dec 23, 2008
  5. 4/5 Fix BaseFetchPackConnection's output of selected capabilitiesShawn O. Pearce, Dec 23, 2008
  6. 5/5 Switch local fetch connection to use our own UploadPackShawn O. Pearce, Dec 23, 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.