MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / get_current_commit

Method get_current_commit

src/test_utils/git_test_utils.rs:63–69  ·  view source on GitHub ↗

Gets the SHA of the current commit.

(&self)

Source from the content-addressed store, hash-verified

61
62 /// Gets the SHA of the current commit.
63 pub fn get_current_commit(&self) -> Result<String> {
64 let output = self
65 .run_git_command(&["rev-parse", "HEAD"])
66 .context("Failed to get current commit")?;
67
68 Ok(output.trim().to_string())
69 }
70
71 /// Runs a git command in the repository directory.
72 pub fn run_git_command(&self, args: &[&str]) -> Result<String> {

Calls 1

run_git_commandMethod · 0.80

Tested by

no test coverage detected