diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2017-08-22 21:23:41 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2017-08-22 21:25:19 +0200 |
commit | ce7cc08eeb78ebec41a1a29a18ba80c272d2f0eb (patch) | |
tree | 622f367aba23968ddb3eb6c7c9650e3d6765b99a /src/lib.rs | |
parent | c8a40229dabee642d598a9a8f852e33e6a183780 (diff) |
master: Added docs
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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<String, git2::Error> { let git_repo = Repository::discover("./")?; let head = git_repo.head()?; @@ -28,4 +29,3 @@ pub fn get_current_branch() -> Result<String, git2::Error> { None => Err(git2::Error::from_str("No branch name found")) } } - |