From 439dac11d5f317604b43918fce6c91a31ce15d9f Mon Sep 17 00:00:00 2001 From: khanism Date: Fri, 16 Feb 2024 02:10:07 +0100 Subject: [PATCH] Ignoring statuses of synched files under vendor when publishing --- src/command.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/command.rs b/src/command.rs index c8b334e2..ef06f2a3 100644 --- a/src/command.rs +++ b/src/command.rs @@ -204,8 +204,16 @@ pub async fn publish( ) -> miette::Result<()> { #[cfg(feature = "git")] if let Ok(repository) = git2::Repository::discover(Path::new(".")) { + + let mut status_options = git2::StatusOptions::default(); + let status_options = Some(status_options + .include_untracked(true) + .pathspec("Proto.toml") + .pathspec("proto/*.proto") + ); + let statuses = repository - .statuses(None) + .statuses(status_options) .into_diagnostic() .wrap_err(miette!("failed to determine repository status"))?;