.iterator();
PackFile singlePack = packIt.next();
assertFalse(packIt.hasNext());
- File keepFile = new File(singlePack.getPackFile().getPath() + ".keep");
+ String packFileName = singlePack.getPackFile().getPath();
+ String keepFileName = packFileName.substring(0,
+ packFileName.lastIndexOf('.')) + ".keep";
+ File keepFile = new File(keepFileName);
assertFalse(keepFile.exists());
assertTrue(keepFile.createNewFile());
bb.commit().add("A", "A2").add("B", "B2").create();
package org.eclipse.jgit.internal.storage.file;
import static org.eclipse.jgit.internal.storage.pack.PackExt.BITMAP_INDEX;
+import static org.eclipse.jgit.internal.storage.pack.PackExt.KEEP;
import static org.eclipse.jgit.internal.storage.pack.PackExt.INDEX;
import java.io.EOFException;
*/
public boolean shouldBeKept() {
if (keepFile == null)
- keepFile = new File(packFile.getPath() + ".keep"); //$NON-NLS-1$
+ keepFile = extFile(KEEP);
return keepFile.exists();
}
/** A pack index file extension. */
public static final PackExt INDEX = newPackExt("idx"); //$NON-NLS-1$
+ /** A keep pack file extension. */
+ public static final PackExt KEEP = newPackExt("keep"); //$NON-NLS-1$
+
/** A pack bitmap index file extension. */
public static final PackExt BITMAP_INDEX = newPackExt("bitmap"); //$NON-NLS-1$