[PATCH JGit 12/19] moved info/packs into a constant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: mike.gaffney <mike.gaffney@xxxxxxxxxxxxxx>

---
 .../org/spearce/jgit/lib/ObjectDirectoryTest.java  |    5 ++---
 .../src/org/spearce/jgit/lib/Constants.java        |    3 +++
 .../src/org/spearce/jgit/lib/ObjectDirectory.java  |    2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectDirectoryTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectDirectoryTest.java
index 4ac62fa..b27f2f8 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectDirectoryTest.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectDirectoryTest.java
@@ -79,7 +79,7 @@ public void testListLocalPacksWhenThereIsAPack() throws Exception {
 		assertEquals(TEST_PACK.getName(), localPacks.get(0).getPackFile().getName());
 	}
 	
-	public void testUpdateInfoCacheCreatesPacksFile() throws Exception {
+	public void testUpdateInfoCacheCreatesPacksAndRefsFile() throws Exception {
 		createSamplePacksDir();
 
 		ObjectDirectory od = new ObjectDirectory(testDir);
@@ -87,7 +87,7 @@ public void testUpdateInfoCacheCreatesPacksFile() throws Exception {
 		od.updateInfoCache();
 		
 		String expectedContents = new PacksFileContentsCreator(od.listLocalPacks()).toString();
-		File packsFile = new File(od.getDirectory(), "info/packs");
+		File packsFile = new File(od.getDirectory(), Constants.CACHED_PACKS_FILE);
 
 		assertTrue(packsFile.exists());
 		assertEquals(expectedContents, JGitTestUtil.readFileAsString(packsFile));
@@ -103,7 +103,6 @@ public boolean deleteDir(File dir) {
                 }
             }
         }
-    
         // The directory is now empty so delete it
         return dir.delete();
     }
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Constants.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Constants.java
index 9afea67..2d78dda 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Constants.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Constants.java
@@ -224,6 +224,9 @@
 
 	/** Info refs folder */
 	public static final String INFO_REFS = "info/refs";
+	
+	/** cached packs file */
+	public static final String CACHED_PACKS_FILE = "info/packs"; 
 
 	/** Packed refs file */
 	public static final String PACKED_REFS = "packed-refs";
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectDirectory.java b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectDirectory.java
index 71536c9..f4251c1 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectDirectory.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectDirectory.java
@@ -517,6 +517,6 @@ boolean tryAgain(final long currLastModified) {
 
 	@Override
 	public void updateInfoCache() throws IOException {
-		new UpdateDirectoryBasedPacksInfoCache(this.listLocalPacks(), new File(this.infoDirectory, "packs")).execute();
+		new UpdateDirectoryBasedPacksInfoCache(this.listLocalPacks(), new File(this.getDirectory(), Constants.CACHED_PACKS_FILE)).execute();
 	}
 }
-- 
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]