summaryrefslogtreecommitdiff
path: root/cli/tools/registry/mod.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-02-28 21:35:02 +0000
committerGitHub <noreply@github.com>2024-02-28 21:35:02 +0000
commitc9b2139b1e7e1240db792173118b7d54d16c5f73 (patch)
tree34f3b7a037098d48e4c2258a52d4a664d5f61c9b /cli/tools/registry/mod.rs
parent918c5e648f4bd08d768374ccde1b451b84793b76 (diff)
Revert "fix(publish): error if there are uncommitted changes (#22613)" (#22625)
This reverts commit c2c4e745a5db4f2e53aa70bf22b6c828fa1b4040.
Diffstat (limited to 'cli/tools/registry/mod.rs')
-rw-r--r--cli/tools/registry/mod.rs37
1 files changed, 0 insertions, 37 deletions
diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs
index deb1d6cb2..b862ed6a6 100644
--- a/cli/tools/registry/mod.rs
+++ b/cli/tools/registry/mod.rs
@@ -2,8 +2,6 @@
use std::collections::HashMap;
use std::io::IsTerminal;
-use std::path::Path;
-use std::process::Stdio;
use std::rc::Rc;
use std::sync::Arc;
@@ -26,7 +24,6 @@ use lsp_types::Url;
use serde::Deserialize;
use serde::Serialize;
use sha2::Digest;
-use tokio::process::Command;
use crate::args::jsr_api_url;
use crate::args::jsr_url;
@@ -940,12 +937,6 @@ pub async fn publish(
return Ok(());
}
- if !publish_flags.allow_dirty
- && check_if_git_repo_dirty(cli_options.initial_cwd()).await
- {
- bail!("Aborting due to uncomitted changes",);
- }
-
perform_publish(
cli_factory.http_client(),
prepared_data.publish_order_graph,
@@ -1025,34 +1016,6 @@ fn verify_version_manifest(
Ok(())
}
-async fn check_if_git_repo_dirty(cwd: &Path) -> bool {
- let bin_name = if cfg!(windows) { "git.exe" } else { "git" };
-
- // Check if git exists
- let git_exists = Command::new(bin_name)
- .arg("--version")
- .stderr(Stdio::null())
- .stdout(Stdio::null())
- .status()
- .await
- .map_or(false, |status| status.success());
-
- if !git_exists {
- return false; // Git is not installed
- }
-
- // Check if there are uncommitted changes
- let output = Command::new(bin_name)
- .current_dir(cwd)
- .args(["status", "--porcelain"])
- .output()
- .await
- .expect("Failed to execute command");
-
- let output_str = String::from_utf8_lossy(&output.stdout);
- !output_str.trim().is_empty()
-}
-
#[cfg(test)]
mod tests {
use super::tar::PublishableTarball;