Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bugfix to avoid errors due to Git subcommands returning ANSI color ou…

…tput.
  • Loading branch information...
commit 871f5edee23fa4e00ba65d7295a8658eb4b895b6 1 parent ac949bf
@nvie authored
View
2  git-flow-feature
@@ -74,7 +74,7 @@ cmd_list() {
warn ""
exit 0
fi
- current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g')
+ current_branch=$(git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g')
short_names=$(echo "$feature_branches" | sed "s ^$PREFIX g")
# determine column width first
View
4 git-flow-hotfix
@@ -69,7 +69,7 @@ cmd_list() {
warn ""
exit 0
fi
- current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g')
+ current_branch=$(git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g')
short_names=$(echo "$hotfix_branches" | sed "s ^$PREFIX g")
# determine column width first
@@ -137,7 +137,7 @@ require_version_arg() {
}
require_base_is_on_master() {
- if ! git branch --contains "$BASE" 2>/dev/null \
+ if ! git branch --color=never --contains "$BASE" 2>/dev/null \
| sed 's/[* ] //g' \
| grep -q "^$MASTER_BRANCH\$"; then
die "fatal: Given base '$BASE' is not a valid commit on '$MASTER_BRANCH'."
View
4 git-flow-release
@@ -70,7 +70,7 @@ cmd_list() {
exit 0
fi
- current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g')
+ current_branch=$(git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g')
short_names=$(echo "$release_branches" | sed "s ^$PREFIX g")
# determine column width first
@@ -132,7 +132,7 @@ require_version_arg() {
}
require_base_is_on_develop() {
- if ! git branch --contains "$BASE" 2>/dev/null \
+ if ! git branch --color=never --contains "$BASE" 2>/dev/null \
| sed 's/[* ] //g' \
| grep -q "^$DEVELOP_BRANCH\$"; then
die "fatal: Given base '$BASE' is not a valid commit on '$DEVELOP_BRANCH'."
View
4 git-flow-support
@@ -71,7 +71,7 @@ cmd_list() {
warn ""
exit 0
fi
- current_branch=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g')
+ current_branch=$(git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g')
short_names=$(echo "$support_branches" | sed "s ^$PREFIX g")
# determine column width first
@@ -148,7 +148,7 @@ require_base_arg() {
}
require_base_is_on_master() {
- if ! git branch --contains "$BASE" 2>/dev/null \
+ if ! git branch --color=never --contains "$BASE" 2>/dev/null \
| sed 's/[* ] //g' \
| grep -q "^$MASTER_BRANCH\$"; then
die "fatal: Given base '$BASE' is not a valid commit on '$MASTER_BRANCH'."
View
10 gitflow-common
@@ -66,13 +66,13 @@ noflag() { local FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -ne $FLAGS_TRUE ]; }
# Git specific common functionality
#
-git_local_branches() { git branch | sed 's/^[* ] //'; }
-git_remote_branches() { git branch -r | sed 's/^[* ] //'; }
-git_all_branches() { ( git branch; git branch -r) | sed 's/^[* ] //'; }
+git_local_branches() { git branch --color=never | sed 's/^[* ] //'; }
+git_remote_branches() { git branch -r --color=never | sed 's/^[* ] //'; }
+git_all_branches() { ( git branch --color=never; git branch -r --color=never) | sed 's/^[* ] //'; }
git_all_tags() { git tag; }
git_current_branch() {
- git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g'
+ git branch --color=never | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g'
}
git_is_clean_working_tree() {
@@ -140,7 +140,7 @@ git_compare_branches() {
git_is_branch_merged_into() {
local subject=$1
local base=$2
- local all_merges=$(git branch --contains $subject | sed 's/^[* ] //')
+ local all_merges=$(git branch --color=never --contains $subject | sed 's/^[* ] //')
has $base $all_merges
}
Please sign in to comment.
Something went wrong with that request. Please try again.