Created
November 7, 2014 17:23
-
-
Save adamhjk/ead9de51d6f6d3aefeb2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn review(opts: &[&str]) { | |
let target = match opts { | |
[ "--for", p ] => p, | |
_ => "master" | |
}; | |
let cwd = os::getcwd(); | |
let have_dot_git = have_dot_git(cwd.clone()); | |
let dot_git_dir: &Path = match have_dot_git.as_ref() { | |
Some(path) => path, | |
None => { panic!("{} does not appear to have a controlling .git directory; you are not in a git repository!", cwd.display()) }, | |
}; | |
let branch = current_branch(dot_git_dir); | |
println!("The branch is {}", branch); | |
if branch.as_slice() == target { | |
git_push(branch.as_slice(), target); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment