Skip to content

Commit

Permalink
refactor: get gix-command via gix with command feature
Browse files Browse the repository at this point in the history
Enabling gix's "command" feature allows access to gix-command via
`gix::command`, which is consistent with how other gitoxide features are
accessed by StGit.
  • Loading branch information
jpgrayson committed May 5, 2024
1 parent 39e1507 commit d45886a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ clap = { version = "~4.5", default-features = false, features = [
ctrlc = "3.4"
encoding_rs = "0.8"
flate2 = "1"
gix = { version = "0.62", default-features = false, features = ["revision"] }
gix-command = "0.3.4"
gix = { version = "0.62", default-features = false, features = ["command", "revision"] }
indexmap = "2.1"
is-terminal = "0.4"
nom = { version = "7", default_features = false, features = ["std"] }
Expand Down
4 changes: 2 additions & 2 deletions src/hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub(crate) fn run_pre_commit_hook(repo: &gix::Repository, use_editor: bool) -> R
let work_dir = repo.work_dir().expect("not a bare repo");

let mut hook_command = std::process::Command::from(
gix_command::prepare(hook_path).stdout(std::process::Stdio::inherit()),
gix::command::prepare(hook_path).stdout(std::process::Stdio::inherit()),
);
hook_command.current_dir(work_dir);
if !use_editor {
Expand Down Expand Up @@ -120,7 +120,7 @@ pub(crate) fn run_commit_msg_hook<'repo>(
// TODO: when git runs this hook, it only sets GIT_INDEX_FILE and sometimes
// GIT_EDITOR. So author and committer vars are not clearly required.
let mut hook_command = std::process::Command::from(
gix_command::prepare(hook_path).stdout(std::process::Stdio::inherit()),
gix::command::prepare(hook_path).stdout(std::process::Stdio::inherit()),
);
hook_command.current_dir(work_dir);
hook_command.env("GIT_INDEX_FILE", &index_path);
Expand Down
2 changes: 1 addition & 1 deletion src/patch/edit/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub(crate) fn call_editor<P: AsRef<Path>>(
stderr.flush()?;
}

let status_result = gix_command::prepare(&editor)
let status_result = gix::command::prepare(&editor)
.arg(path.as_ref())
.with_shell_allow_argument_splitting()
.stdin(std::process::Stdio::inherit())
Expand Down

0 comments on commit d45886a

Please sign in to comment.