Skip to content

[WIP] Fix re-staging of files after task execution with ${staged:separator}#174

Closed
Copilot wants to merge 1 commit into
masterfrom
copilot/fix-staged-separator-issue
Closed

[WIP] Fix re-staging of files after task execution with ${staged:separator}#174
Copilot wants to merge 1 commit into
masterfrom
copilot/fix-staged-separator-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 28, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>${staged:separator} pattern does not re-stage files after task execution</issue_title>
<issue_description>### Version

latest

Details

When using the ${staged:separator} variable pattern (e.g., --include=${staged:;}) in a task definition, Husky.Net doesn't re-stage files after the task modifies them. This means formatting changes made by tools like jb cleanupcode are left as unstaged modifications in the working tree, while the commit is finalized with the original unformatted content.

The ${staged} pattern (without a separator) works correctly.

Steps to reproduce

  1. Configure a pre-commit task using ${staged:;}:
{
   "tasks": [
      {
         "name": "resharper-cleanup",
         "group": "pre-commit",
         "command": "dotnet",
         "pathMode": "relative",
         "include": ["**/*.cs"],
         "args": [
            "jb",
            "cleanupcode",
            "--profile=Built-in: Reformat Code",
            "--include=${staged:;}",
            "MyProject.slnx"
         ]
      }
   ]
}
  1. Stage a .cs file that has formatting issues.
  2. Run git commit.
  3. Observe that the commit contains unformatted code and the formatted changes are left in the working tree unstaged.</issue_description>

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

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.

${staged:separator} pattern does not re-stage files after task execution

2 participants