Skip to content

Commit

Permalink
Unified notation for stderr file descriptor redirection.
Browse files Browse the repository at this point in the history
  • Loading branch information
nvie committed Jan 25, 2010
1 parent 7238e29 commit 144bb50
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gitflow-sh-setup
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,34 @@ warn() { echo "$@" >&2; }
die() { warn "$@"; exit 1; }

gitflow_check_clean_working_tree() {
if [ "$(git status 2> /dev/null | tail -n1)" != "nothing to commit (working directory clean)" ]; then
if [ "$(git status 2>/dev/null | tail -n1)" != "nothing to commit (working directory clean)" ]; then
die "Working directory is dirty. Only use gitflow in clean working directories for your own safety."
fi
}

gitflow_require_local_branch() {
echo "$LOCAL_BRANCHES" | grep "^$1\$" 2>/dev/null >/dev/null
echo "$LOCAL_BRANCHES" | grep "^$1\$" 2>&1 >/dev/null
if [ $? -ne 0 ]; then
die "Local branch '$1' does not exist and is required."
fi
}

gitflow_require_remote_branch() {
echo "$REMOTE_BRANCHES" | grep "^$1\$" 2>/dev/null >/dev/null
echo "$REMOTE_BRANCHES" | grep "^$1\$" 2>&1 >/dev/null
if [ $? -ne 0 ]; then
die "Remote branch '$1' does not exist and is required."
fi
}

gitflow_require_branch() {
echo "$ALL_BRANCHES" | grep "^$1\$" 2>/dev/null >/dev/null
echo "$ALL_BRANCHES" | grep "^$1\$" 2>&1 >/dev/null
if [ $? -ne 0 ]; then
die "Branch '$1' does not exist and is required."
fi
}

gitflow_require_branch_absent() {
echo "$ALL_BRANCHES" | grep "^$1\$" 2>/dev/null >/dev/null
echo "$ALL_BRANCHES" | grep "^$1\$" 2>&1 >/dev/null
if [ $? -eq 0 ]; then
die "Branch '$1' already exists. Pick another name."
fi
Expand Down

0 comments on commit 144bb50

Please sign in to comment.