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

[JGIT PATCH 6/9] Rename readPackHeader() to be onOpenPack()

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 12, 2009, 02:36 UTC
Message-ID
<1234406219-19547-7-git-send-email-spearce@spearce.org>
In-Reply-To
<1234406219-19547-6-git-send-email-spearce@spearce.org>

Its just a better name of the function. Any logic we might try to perform to validate the pack file as we open it up to read should be here, and that logic may eventually include validation of the footer checksum against the index's footer data.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 .../src/org/spearce/jgit/lib/PackFile.java         |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java
index 7a16bf7..d34df03 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java
@@ -89,7 +89,7 @@ public PackFile(final File idxFile, final File packFile) {
 		pack = new WindowedFile(packFile) {
 			@Override
 			protected void onOpen() throws IOException {
-				readPackHeader();
+				onOpenPack();
 			}
 		};
 	}
@@ -264,8 +264,7 @@ boolean supportsFastCopyRawData() throws IOException {
 		return idx().hasCRC32Support();
 	}
 
-
-	private void readPackHeader() throws IOException {
+	private void onOpenPack() throws IOException {
 		final WindowCursor curs = new WindowCursor();
 		long position = 0;
 		final byte[] sig = new byte[Constants.PACK_SIGNATURE.length];
-- 
1.6.2.rc0.204.gf6b427
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 7 of 10 in “Misc. pack code cleanups”
  1. 0/9 Misc. pack code cleanupsShawn O. Pearce, Feb 12, 2009
  2. 1/9 Remove the Repository parameter from PackFile's constructorShawn O. Pearce, Feb 12, 2009
  3. 2/9 Remove dead stats code from WindowCacheShawn O. Pearce, Feb 12, 2009
  4. 3/9 Document why WindowFile's hash is *31Shawn O. Pearce, Feb 12, 2009
  5. 4/9 Allow PackFile to lazily load its PackIndex on first demandShawn O. Pearce, Feb 12, 2009
  6. 5/9 Arrange pack files in recency order to improve quick hitsShawn O. Pearce, Feb 12, 2009
  7. 6/9 Rename readPackHeader() to be onOpenPack()Shawn O. Pearce, Feb 12, 2009
  8. 7/9 Validate the pack's footer checksum matches that in the indexShawn O. Pearce, Feb 12, 2009
  9. 8/9 Remove yet another legacy StGit utility functionShawn O. Pearce, Feb 12, 2009
  10. 9/9 Make pack.indexversion config option default to version 2Shawn O. Pearce, Feb 12, 2009

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.