summaryrefslogtreecommitdiffstats
path: root/src/git.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/git.rs')
-rw-r--r--src/git.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/git.rs b/src/git.rs
index 293f225..0f59c69 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -7,12 +7,12 @@ use std::str::Utf8Error;
use regex::Regex;
#[derive(Debug, PartialEq)]
-struct Blob<'a> {
- object: &'a str,
- path: &'a Path,
+pub struct Blob<'a> {
+ pub object: &'a str,
+ pub path: &'a Path,
}
-fn crawl_git_tree<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
+pub fn crawl_git_tree<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
let output = Command::new("git")
.current_dir(path)
.args(&["ls-tree", "-zr", "HEAD"])
@@ -28,7 +28,7 @@ fn crawl_git_tree<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
Ok(output.stdout)
}
-fn parse_ls_tree_output<'a>(output: &'a [u8]) -> Result<Vec<Blob<'a>>, Utf8Error> {
+pub fn parse_ls_tree_output<'a>(output: &'a [u8]) -> Result<Vec<Blob<'a>>, Utf8Error> {
let re = Regex::new(r"^[^ ]+ [^ ]+ ([^\t]+)\t(.+)$").unwrap();
let mut blobs = Vec::new();