Skip to main content

read_file_at_ref

Function read_file_at_ref 

Source
pub fn read_file_at_ref(worktree_path: &Path, ref_path: &str) -> Result<String>
Expand description

Read file content at a specific git ref (branch, commit, tag). Format: “ref:path/to/file” e.g., “main:src/lib.rs” or “abc123:file.txt”

§Errors

Returns an error when the repository cannot be found, ref is invalid, or file doesn’t exist.