pksunkara/cargo-workspaces

Dirty directory error, but cargo-workspaces is responsible

aasseman opened this issue · 3 comments

I am trying to use cargo workspaces publish --from-git on my repo, but I get:

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

Cargo.toml

to proceed despite this and include the uncommitted changes, pass the `--allow-dirty` flag
error: unable to publish package tap_core

The problem is that I am 100% sure the directory is not dirty, but in fact cargo workspaces publish modifies the Cargo.toml, then complains about it. Here's a video:

Screencast_20230629_155911.webm.mp4

A workaround is to use --no-remove-dev-deps.

Yes, unfortunately, we had to enable this by default because of how cargo treats workspace dev-dependencies.

Maybe, there's a way to have a better smart default in the future.

Published 0.2.44 with a smarter default that should fix your issue.