Skip to content

cargo publish produces "X files in the working directory contain changes that were not yet committed into git" for .gitignored files #16540

@Byron

Description

@Byron

I see this regularly when publishing gitoxide crates and thought this was fixed with the switch to gitoxide, using cargo 1.92.0 (344c456 2025-10-21).

error: 4 files in the working directory contain changes that were not yet committed into git:

gix-dir/tests/fixtures/generated-do-not-edit/many/613585535-unix/slash-in-root-and-negated/.github/workflow.yml
gix-dir/tests/fixtures/generated-do-not-edit/many/613585535-unix/slash-in-subdir-and-negated/sub/.github/workflow.yml
gix-dir/tests/fixtures/generated-do-not-edit/many/613585535-unix/star-in-root-and-negated/.github/workflow.yml
gix-dir/tests/fixtures/generated-do-not-edit/many/613585535-unix/star-in-subdir-and-negated/sub/.github/workflow.yml

The commit that introduces gix into the cargo publish is old enough to be included.
Then again, the src_files seem to depend on the ignore crate via this commit.

This might be the culprit.

let mut exclude_builder = GitignoreBuilder::new(root);

Is there interest in having this gitoxide'ified?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions