Skip to content

add support for external ssh signing #2198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test
  • Loading branch information
seanaye committed Mar 6, 2025
commit d069623d6081e805b116d4a2f8d799d1e9ab4130
20 changes: 20 additions & 0 deletions asyncgit/src/sync/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,4 +623,24 @@ mod tests {

Ok(())
}

#[test]
fn test_external_ssh_binary() -> Result<()> {
let (_tmp_dir, repo) = repo_init_empty()?;

{
let mut config = repo.config()?;
config.set_str("gpg.program", "ssh")?;
config.set_str("user.signingKey", "/tmp/key.pub")?;
config.set_str("gpg.ssh.program", "/bin/cat")?;
}

let sign =
SignBuilder::from_gitconfig(&repo, &repo.config()?)?;

assert_eq!("/bin/cat", sign.program());
assert_eq!("/tmp/key.pub", sign.signing_key());

Ok(())
}
}