MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / short_commit

Function short_commit

atomic-cli/build.rs:18–22  ·  view source on GitHub ↗
(commit: &str)

Source from the content-addressed store, hash-verified

16}
17
18fn short_commit(commit: &str) -> Option<&str> {
19 let commit = commit.trim();
20 (commit.len() >= 12 && commit.len() <= 64 && commit.bytes().all(|b| b.is_ascii_hexdigit()))
21 .then(|| &commit[..12])
22}
23
24fn watch_repository(root: &Path) {
25 // --git-path resolves shared refs and worktree-local HEAD/index correctly.

Callers 1

mainFunction · 0.85

Calls 3

lenMethod · 0.45
allMethod · 0.45
bytesMethod · 0.45

Tested by

no test coverage detected