diff options
author | Xing Huang <xingkhuang@google.com> | 2024-03-12 16:32:46 -0500 |
---|---|---|
committer | Xing Huang <xingkhuang@google.com> | 2024-03-14 11:57:52 -0500 |
commit | c1eba8abe04493ceb9b30c4f747fb0255c4f28e1 (patch) | |
tree | 40edea9684abacfe100814b1b401de176dbbe19d /org.eclipse.jgit | |
parent | a052d54916c8828207a9743801384da7002a13c4 (diff) | |
download | jgit-c1eba8abe04493ceb9b30c4f747fb0255c4f28e1.tar.gz jgit-c1eba8abe04493ceb9b30c4f747fb0255c4f28e1.zip |
DfsPackFile: get commitGraph.readChangePaths from repo config
By default, CommitGraphLoader reads the readChangedPaths flag from
SystemReader ignoring the values set at repo-level.
Read the value of the property from the repo configuration and pass it
to CommitGraphLoader.
Signed-off-by: Xing Huang <xingkhuang@google.com>
Change-Id: I34c807714c5a7573769ba9d611457aa107006244
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java index 42b1d235bf..2e534d580f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java @@ -52,10 +52,12 @@ import org.eclipse.jgit.internal.storage.pack.PackOutputStream; import org.eclipse.jgit.internal.storage.pack.StoredObjectRepresentation; import org.eclipse.jgit.lib.AbbreviatedObjectId; import org.eclipse.jgit.lib.AnyObjectId; +import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectLoader; import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.util.LongList; /** @@ -1283,11 +1285,16 @@ public final class DfsPackFile extends BlockBasedFile { DfsStreamKey cgkey) throws IOException { ctx.stats.readCommitGraph++; long start = System.nanoTime(); + StoredConfig repoConfig = ctx.db.getRepository().getConfig(); + boolean readChangedPathFilters = repoConfig.getBoolean( + ConfigConstants.CONFIG_COMMIT_GRAPH_SECTION, + ConfigConstants.CONFIG_KEY_READ_CHANGED_PATHS, false); try (ReadableChannel rc = ctx.db.openFile(desc, COMMIT_GRAPH)) { long size; CommitGraph cg; try { - cg = CommitGraphLoader.read(alignTo8kBlocks(rc)); + cg = CommitGraphLoader.read(alignTo8kBlocks(rc), + readChangedPathFilters); } finally { size = rc.position(); ctx.stats.readCommitGraphBytes += size; |