Skip to content

Instantly share code, notes, and snippets.

@adamhjk
Created November 7, 2014 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamhjk/ead9de51d6f6d3aefeb2 to your computer and use it in GitHub Desktop.
Save adamhjk/ead9de51d6f6d3aefeb2 to your computer and use it in GitHub Desktop.
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