MCPcopy Create free account
hub / github.com/AIScientists-Dev/Flowtrace / translate

Function translate

crates/flowtrace-cli/src/git.rs:92–97  ·  view source on GitHub ↗

Prefix a trace-relative path with the subpath portion, if any. Used when looking up paths via libgit2 (commits_under, show_at) — git always wants repo-relative paths even though the caller speaks trace-relative.

(repo: &Repository, root: &Path, rel: &str)

Source from the content-addressed store, hash-verified

90/// looking up paths via libgit2 (commits_under, show_at) — git always wants
91/// repo-relative paths even though the caller speaks trace-relative.
92fn translate(repo: &Repository, root: &Path, rel: &str) -> String {
93 match repo_subpath(repo, root) {
94 Some(sub) => sub.join(rel).to_string_lossy().replace('\\', "/"),
95 None => rel.to_string(),
96 }
97}
98
99fn signature() -> Result<Signature<'static>> {
100 Signature::now(AUTHOR_NAME, AUTHOR_EMAIL).context("building git signature")

Callers 4

commits_underFunction · 0.85
with_subtree_atFunction · 0.85
introducing_commitsFunction · 0.85
show_at_with_blob_shaFunction · 0.85

Calls 1

repo_subpathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…