use exported diff lines limit
This commit is contained in:
parent
6635d021b7
commit
559faae153
2 changed files with 2 additions and 4 deletions
|
|
@ -2,7 +2,7 @@ import { ToolImpl } from ".";
|
|||
import { ContextItem } from "../..";
|
||||
import { getDiffsFromCache } from "../../autocomplete/snippets/gitDiffCache";
|
||||
|
||||
const DEFAULT_GIT_DIFF_LINE_LIMIT = 5000;
|
||||
export const DEFAULT_GIT_DIFF_LINE_LIMIT = 5000;
|
||||
|
||||
export const viewDiffImpl: ToolImpl = async (args, extras) => {
|
||||
const diffs = await getDiffsFromCache(extras.ide); // const diffs = await extras.ide.getDiff(true);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { expect, test, vi } from "vitest";
|
||||
import { viewDiffImpl } from "./viewDiff";
|
||||
import { DEFAULT_GIT_DIFF_LINE_LIMIT, viewDiffImpl } from "./viewDiff";
|
||||
|
||||
// Mock the getDiffsFromCache function
|
||||
vi.mock("../../autocomplete/snippets/gitDiffCache", () => ({
|
||||
|
|
@ -37,8 +37,6 @@ test("viewDiff should not truncate diffs under line limit", async () => {
|
|||
});
|
||||
|
||||
test("viewDiff should truncate diffs exceeding line limit", async () => {
|
||||
const DEFAULT_GIT_DIFF_LINE_LIMIT = 5000;
|
||||
|
||||
// Create a large diff that exceeds the line limit
|
||||
const largeDiffLines = Array(DEFAULT_GIT_DIFF_LINE_LIMIT + 1000).fill(
|
||||
"line content",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue