diff --git a/CHANGELOG.md b/CHANGELOG.md index e78dd13dbe..5892366a6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [3.1.2] + +- Fix issue where LFS files would be not be ignored when creating checkpoints + ## [3.1.0] - Added checkpoints: Snapshots of workspace are automatically created whenever Cline uses a tool diff --git a/package.json b/package.json index 86cad9d838..0832a8533f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "claude-dev", "displayName": "Cline (prev. Claude Dev)", "description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.", - "version": "3.1.1", + "version": "3.1.2", "icon": "assets/icons/icon.png", "galleryBanner": { "color": "#617A91", diff --git a/src/integrations/checkpoints/CheckpointTracker.ts b/src/integrations/checkpoints/CheckpointTracker.ts index 36a0c5a52e..09aabbbc16 100644 --- a/src/integrations/checkpoints/CheckpointTracker.ts +++ b/src/integrations/checkpoints/CheckpointTracker.ts @@ -105,6 +105,21 @@ class CheckpointTracker { await git.addConfig("core.worktree", this.cwd) // sets the working tree to the current workspace + // Get LFS patterns from workspace if they exist + let lfsPatterns: string[] = [] + try { + const attributesPath = path.join(this.cwd, ".gitattributes") + if (await fileExistsAtPath(attributesPath)) { + const attributesContent = await fs.readFile(attributesPath, "utf8") + lfsPatterns = attributesContent + .split("\n") + .filter((line) => line.includes("filter=lfs")) + .map((line) => line.split(" ")[0].trim()) + } + } catch (error) { + console.warn("Failed to read .gitattributes:", error) + } + // Add basic excludes directly in git config, while respecting any .gitignore in the workspace // .git/info/exclude is local to the shadow git repo, so it's not shared with the main repo - and won't conflict with user's .gitignore // TODO: let user customize these @@ -198,6 +213,7 @@ class CheckpointTracker { "npm-debug.log*", "yarn-debug.log*", "yarn-error.log*", + ...lfsPatterns, ].join("\n"), )