소스 검색

Remove unneeded packs when compacting with no new objects

Previously, the DfsPackCompactor exited without pruning the existing
packs, when no new packs were created.

Change-Id: I5e3b6f8c789706c7a982e6ae93cf7c3d4346797c
tags/v3.1.0.201309270735-rc1
Colby Ranger 10 년 전
부모
커밋
7dc6c553c0
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7
    1
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java

+ 7
- 1
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java 파일 보기

@@ -220,8 +220,14 @@ public class DfsPackCompactor {
pw.setReuseDeltaCommits(false);

addObjectsToPack(pw, ctx, pm);
if (pw.getObjectCount() == 0)
if (pw.getObjectCount() == 0) {
List<DfsPackDescription> remove = toPrune();
if (remove.size() > 0)
objdb.commitPack(
Collections.<DfsPackDescription>emptyList(),
remove);
return;
}

boolean rollback = true;
DfsPackDescription pack = objdb.newPack(COMPACT);

Loading…
취소
저장