Skip to content

Conversation

@nearestnabors
Copy link
Contributor

@nearestnabors nearestnabors commented Jan 21, 2026

Summary

  • Fix update-links section to not accidentally stage unrelated working directory changes
  • Captures already-modified files BEFORE running update-links, then only stages newly-modified files

Problem

The update-links section was using git diff --name-only which captures ALL modified files in the working directory, not just files modified by the update-links script. This could accidentally stage files the user had modified but intentionally not staged for the current commit.

Test plan

  • Modify an mdx file but don't stage it
  • Stage next.config.ts with a new redirect
  • Run commit - verify the unstaged mdx file is NOT automatically staged
  • Verify files actually modified by update-links ARE staged

🤖 Generated with Claude Code


Note

Ensures the update-links step in .husky/pre-commit does not stage unrelated working changes.

  • Captures ALREADY_MODIFIED files before running pnpm update-links, then stages only newly modified app/**/*.mdx|md|tsx files
  • Adds count of staged files and warning output listing files skipped due to existing unstaged changes
  • Prevents mixing user unstaged work with automated link updates; updates messaging accordingly

Written by Cursor Bugbot for commit 4c5bf20. This will update automatically on new commits. Configure here.

The update-links section was using `git diff --name-only` which captures
ALL modified files in the working directory, not just files modified by
the update-links script. This could accidentally stage files the user
had modified but intentionally not staged for the current commit.

Fix: Capture the list of already-modified files BEFORE running update-links,
then only stage files that weren't already modified (i.e., files that became
modified as a result of update-links).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 21, 2026 2:36am

Request Review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants