Commit 144bb507 authored by Vincent Driessen's avatar Vincent Driessen

Unified notation for stderr file descriptor redirection.

parent 7238e295
...@@ -24,34 +24,34 @@ warn() { echo "$@" >&2; } ...@@ -24,34 +24,34 @@ warn() { echo "$@" >&2; }
die() { warn "$@"; exit 1; } die() { warn "$@"; exit 1; }
gitflow_check_clean_working_tree() { 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." die "Working directory is dirty. Only use gitflow in clean working directories for your own safety."
fi fi
} }
gitflow_require_local_branch() { 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 if [ $? -ne 0 ]; then
die "Local branch '$1' does not exist and is required." die "Local branch '$1' does not exist and is required."
fi fi
} }
gitflow_require_remote_branch() { 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 if [ $? -ne 0 ]; then
die "Remote branch '$1' does not exist and is required." die "Remote branch '$1' does not exist and is required."
fi fi
} }
gitflow_require_branch() { 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 if [ $? -ne 0 ]; then
die "Branch '$1' does not exist and is required." die "Branch '$1' does not exist and is required."
fi fi
} }
gitflow_require_branch_absent() { 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 if [ $? -eq 0 ]; then
die "Branch '$1' already exists. Pick another name." die "Branch '$1' already exists. Pick another name."
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment