diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsObjDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsObjDatabase.java index 286616e79..b1290d955 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsObjDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsObjDatabase.java @@ -198,6 +198,10 @@ public abstract class DfsObjDatabase extends ObjectDatabase { * During pack compaction or GC the new pack file may be replacing other * older files. Implementations should remove those older files (if any) as * part of the commit of the new file. + *

+ * This method is a trivial wrapper around + * {@link #commitPackImpl(Collection, Collection)} that calls the + * implementation and fires events. * * @param desc * description of the new packs. @@ -207,7 +211,25 @@ public abstract class DfsObjDatabase extends ObjectDatabase { * the packs cannot be committed. On failure a rollback must * also be attempted by the caller. */ - protected abstract void commitPack(Collection desc, + protected void commitPack(Collection desc, + Collection replaces) throws IOException { + commitPackImpl(desc, replaces); + getRepository().fireEvent(new DfsPacksChangedEvent()); + } + + /** + * Implementation of pack commit. + * + * @see #commitPack(Collection, Collection) + * + * @param desc + * description of the new packs. + * @param replaces + * if not null, list of packs to remove. + * @throws IOException + * the packs cannot be committed. + */ + protected abstract void commitPackImpl(Collection desc, Collection replaces) throws IOException; /** diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/InMemoryRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/InMemoryRepository.java index 635e68c2c..966b5182a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/InMemoryRepository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/InMemoryRepository.java @@ -79,7 +79,7 @@ public class InMemoryRepository extends DfsRepository { } @Override - protected synchronized void commitPack( + protected synchronized void commitPackImpl( Collection desc, Collection replace) { List n;