Skip to content

fix(git): isolate trace commits from parent index - #17

Open
Oscar-Williams wants to merge 1 commit into
AIScientists-Dev:mainfrom
Oscar-Williams:fix/16-isolate-parent-index
Open

Oscar-Williams wants to merge 1 commit into
AIScientists-Dev:mainfrom
Oscar-Williams:fix/16-isolate-parent-index

Conversation

@Oscar-Williams

Copy link
Copy Markdown

Summary

When flowtrace init runs inside an existing Git repository, the trace commit reuses the parent repository's live index. Any unrelated staged file is therefore included in the automatic commit.

Closes #16

Changes

  • Build the trace commit tree from HEAD plus the declared trace paths.
  • Restore the caller's index and refresh only those declared paths.
  • Add a regression test for a nested trace with unrelated staged work.

Testing

  • cargo test --locked (flowtrace-cli 20/20, flowtrace-core 30/30)
  • cargo clippy --locked --all-targets (exit 0; existing warnings only)
  • cargo fmt --all -- --check (the current base already contains unrelated formatting drift)
  • CLI check in a temporary parent repository: unrelated staged file remains staged and is absent from the trace commit.

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.

flowtrace init inside an existing Git repo commits unrelated pre-staged files

1 participant