From ce7cc08eeb78ebec41a1a29a18ba80c272d2f0eb Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Tue, 22 Aug 2017 21:23:41 +0200 Subject: master: Added docs --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 18b3476..fff1c85 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ use std::io::{stdin, BufRead}; use git2::Repository; - +// This consumes stdin. Do not call this if you need to use stdin. pub fn log() { let name_arg = env::args().nth(0).unwrap_or(String::from("unknown")); let args: Vec<_> = env::args().skip(1).collect(); @@ -19,6 +19,7 @@ pub fn log() { println!("END STDIN"); } +// Uses libgit to get the name of your current branch pub fn get_current_branch() -> Result { let git_repo = Repository::discover("./")?; let head = git_repo.head()?; @@ -28,4 +29,3 @@ pub fn get_current_branch() -> Result { None => Err(git2::Error::from_str("No branch name found")) } } - -- cgit v1.2.3