Skip to content

Commit

Permalink
GIT_TERMINAL_PROMPT
Browse files Browse the repository at this point in the history
  • Loading branch information
nbari committed Mar 10, 2024
1 parent 9e76310 commit 6631896
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/precmd.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
use crate::get_env;
use git2::{DiffOptions, Error, ObjectType, Repository, StatusOptions, StatusShow};
use serde::{Deserialize, Serialize};
use std::{collections::BTreeMap, env, process::Command, str, thread};
use std::{
collections::BTreeMap,
env,
process::{Command, Stdio},
str, thread,
};

#[derive(Serialize, Deserialize, Debug, Default)]
struct Prompt {
Expand Down Expand Up @@ -42,10 +47,15 @@ fn build_prompt(repo: &Repository) {
if get_env("SLICK_PROMPT_GIT_FETCH") != "0" {
thread::spawn(move || {
Command::new("git")
.env("GIT_TERMINAL_PROMPT", "0")
.arg("-c")
.arg("gc.auto=0")
.arg("fetch")
.output()
.arg("--quiet")
.arg("--no-tags")
.arg("--no-recurse-submodules")
.stderr(Stdio::null())
.spawn()
.expect("failed to execute process");
});
}
Expand Down

0 comments on commit 6631896

Please sign in to comment.