Skip to content
This repository has been archived by the owner on May 8, 2018. It is now read-only.

Commit

Permalink
Don't do anything interesting unless the repo is in a good state.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Donovan committed Aug 13, 2009
1 parent 830cc63 commit d0d1db3
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions bin/git-review
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ printUsage() {


pushReview() {
abort_on_bad_repo_state

change=$1
if [ -z "$change" ]; then
# try to read the change number from the branch name
Expand Down Expand Up @@ -160,6 +162,8 @@ pushReview() {

# git review 100
startReview() {
abort_on_bad_repo_state

$GIT remote show changes 2>/dev/null 1>&2 ||
die "In order to use $this to start a review, you need a 'changes' remote. Please add it before trying again."

Expand Down Expand Up @@ -193,6 +197,8 @@ startReview() {

# git review reset
resetReview() {
abort_on_bad_repo_state

if [ ! -z "$@" ]; then
warn "$this: unrecognized argument $1 for 'reset' subcommand"
printUsage
Expand Down Expand Up @@ -228,6 +234,8 @@ diffPatches() {
}

rebaseReview() {
abort_on_bad_repo_state

change=$1
if [ -z "$change" ]; then
if is_review_branch $CURRENT; then
Expand All @@ -254,12 +262,14 @@ rebaseReview() {
fi
}

if ! no_changes; then
die "You have local changes. Please do something with them before using $this"
fi
abort_on_bad_repo_state() {
if ! no_changes; then
die "You have local changes. Please do something with them before using $this"
fi

$GIT svn info >/dev/null 2>/dev/null &&
die "$this does not support git-svn repositories."
$GIT svn info >/dev/null 2>/dev/null &&
die "$this does not support git-svn repositories."
}

while true; do
arg=$1
Expand Down

0 comments on commit d0d1db3

Please sign in to comment.