Change-Id: I11631afb33a2bb29d994551a0be8775bbe277300 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>tags/v4.0.0.201505050340-m2
fileIsTooBigForThisConvenienceMethod=File is too big for this convenience method ({0} bytes). | fileIsTooBigForThisConvenienceMethod=File is too big for this convenience method ({0} bytes). | ||||
fileIsTooLarge=File is too large: {0} | fileIsTooLarge=File is too large: {0} | ||||
fileModeNotSetForPath=FileMode not set for path {0} | fileModeNotSetForPath=FileMode not set for path {0} | ||||
findingGarbage=Finding garbage | |||||
flagIsDisposed={0} is disposed. | flagIsDisposed={0} is disposed. | ||||
flagNotFromThis={0} not from this. | flagNotFromThis={0} not from this. | ||||
flagsAlreadyCreated={0} flags already created. | flagsAlreadyCreated={0} flags already created. | ||||
submoduleExists=Submodule ''{0}'' already exists in the index | submoduleExists=Submodule ''{0}'' already exists in the index | ||||
submoduleParentRemoteUrlInvalid=Cannot remove segment from remote url ''{0}'' | submoduleParentRemoteUrlInvalid=Cannot remove segment from remote url ''{0}'' | ||||
submodulesNotSupported=Submodules are not supported | submodulesNotSupported=Submodules are not supported | ||||
supportOnlyPackIndexVersion2=Only support index version 2 | |||||
symlinkCannotBeWrittenAsTheLinkTarget=Symlink "{0}" cannot be written as the link target cannot be read from within Java. | symlinkCannotBeWrittenAsTheLinkTarget=Symlink "{0}" cannot be written as the link target cannot be read from within Java. | ||||
systemConfigFileInvalid=Systen wide config file {0} is invalid {1} | systemConfigFileInvalid=Systen wide config file {0} is invalid {1} | ||||
tagAlreadyExists=tag ''{0}'' already exists | tagAlreadyExists=tag ''{0}'' already exists |
/***/ public String fileIsTooBigForThisConvenienceMethod; | /***/ public String fileIsTooBigForThisConvenienceMethod; | ||||
/***/ public String fileIsTooLarge; | /***/ public String fileIsTooLarge; | ||||
/***/ public String fileModeNotSetForPath; | /***/ public String fileModeNotSetForPath; | ||||
/***/ public String findingGarbage; | |||||
/***/ public String flagIsDisposed; | /***/ public String flagIsDisposed; | ||||
/***/ public String flagNotFromThis; | /***/ public String flagNotFromThis; | ||||
/***/ public String flagsAlreadyCreated; | /***/ public String flagsAlreadyCreated; | ||||
/***/ public String submoduleExists; | /***/ public String submoduleExists; | ||||
/***/ public String submodulesNotSupported; | /***/ public String submodulesNotSupported; | ||||
/***/ public String submoduleParentRemoteUrlInvalid; | /***/ public String submoduleParentRemoteUrlInvalid; | ||||
/***/ public String supportOnlyPackIndexVersion2; | |||||
/***/ public String symlinkCannotBeWrittenAsTheLinkTarget; | /***/ public String symlinkCannotBeWrittenAsTheLinkTarget; | ||||
/***/ public String systemConfigFileInvalid; | /***/ public String systemConfigFileInvalid; | ||||
/***/ public String tagAlreadyExists; | /***/ public String tagAlreadyExists; |
import java.util.Map; | import java.util.Map; | ||||
import java.util.Set; | import java.util.Set; | ||||
import org.eclipse.jgit.internal.JGitText; | |||||
import org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource; | import org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource; | ||||
import org.eclipse.jgit.internal.storage.file.PackIndex; | import org.eclipse.jgit.internal.storage.file.PackIndex; | ||||
import org.eclipse.jgit.internal.storage.pack.PackExt; | import org.eclipse.jgit.internal.storage.pack.PackExt; | ||||
if (pm == null) | if (pm == null) | ||||
pm = NullProgressMonitor.INSTANCE; | pm = NullProgressMonitor.INSTANCE; | ||||
if (packConfig.getIndexVersion() != 2) | if (packConfig.getIndexVersion() != 2) | ||||
throw new IllegalStateException("Only index version 2"); | |||||
throw new IllegalStateException( | |||||
JGitText.get().supportOnlyPackIndexVersion2); | |||||
ctx = (DfsReader) objdb.newReader(); | ctx = (DfsReader) objdb.newReader(); | ||||
try { | try { | ||||
RevWalk pool = new RevWalk(ctx)) { | RevWalk pool = new RevWalk(ctx)) { | ||||
pw.setDeltaBaseAsOffset(true); | pw.setDeltaBaseAsOffset(true); | ||||
pw.setReuseDeltaCommits(true); | pw.setReuseDeltaCommits(true); | ||||
pm.beginTask("Finding garbage", objectsBefore()); | |||||
pm.beginTask(JGitText.get().findingGarbage, objectsBefore()); | |||||
for (DfsPackFile oldPack : packsBefore) { | for (DfsPackFile oldPack : packsBefore) { | ||||
PackIndex oldIdx = oldPack.getPackIndex(ctx); | PackIndex oldIdx = oldPack.getPackIndex(ctx); | ||||
for (PackIndex.MutableEntry ent : oldIdx) { | for (PackIndex.MutableEntry ent : oldIdx) { |