Skip to content

Commit

Permalink
Do not quote variable assignments.
Browse files Browse the repository at this point in the history
  • Loading branch information
nvie committed Feb 9, 2010
1 parent fafa2b2 commit c5fcc01
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions git-flow-feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cmd_list() {
typeset feature_branches
typeset current_branch
typeset short_names
feature_branches="$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")"
feature_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
if [ -z "$feature_branches" ]; then
warn "No feature branches exist."
exit 0
Expand All @@ -54,7 +54,7 @@ cmd_list() {

typeset branch
for branch in $short_names; do
typeset fullname="$PREFIX$branch"
typeset fullname=$PREFIX$branch
typeset base=$(git merge-base "$fullname" "$DEVELOP_BRANCH")
typeset develop_sha=$(git rev-parse "$DEVELOP_BRANCH")
typeset branch_sha=$(git rev-parse "$fullname")
Expand Down Expand Up @@ -133,15 +133,15 @@ parse_args() {
eval set -- "${FLAGS_ARGV}"

# read arguments into global variables
NAME="$1"
NAME=$1
BRANCH=$PREFIX$NAME
}

cmd_start() {
DEFINE_boolean fetch false 'fetch from origin before performing local operation' F
DEFINE_boolean force false 'force creation of feature branch (ignores dirty working tree)' f
parse_args "$@"
BASE="${2:-$DEVELOP_BRANCH}"
BASE=${2:-$DEVELOP_BRANCH}
require_name_arg

# sanity checks
Expand Down Expand Up @@ -195,7 +195,7 @@ cmd_finish() {
# exit code for "unmerged changes in working tree", which we should
# actually be testing for here
if gitflow_test_clean_working_tree; then
FINISH_BASE="$(cat "$GIT_DIR/.gitflow/MERGE_BASE")"
FINISH_BASE=$(cat "$GIT_DIR/.gitflow/MERGE_BASE")

# Since the working tree is now clean, either the user did a
# succesfull merge manually, or the merge was cancelled.
Expand Down
12 changes: 6 additions & 6 deletions git-flow-hotfix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cmd_list() {
typeset hotfix_branches
typeset current_branch
typeset short_names
hotfix_branches="$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")"
hotfix_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
if [ -z "$hotfix_branches" ]; then
warn "No hotfix branches exist."
exit 0
Expand All @@ -51,7 +51,7 @@ cmd_list() {

typeset branch
for branch in $short_names; do
typeset fullname="$PREFIX$branch"
typeset fullname=$PREFIX$branch
typeset base=$(git merge-base "$fullname" "$MASTER_BRANCH")
typeset master_sha=$(git rev-parse "$MASTER_BRANCH")
typeset branch_sha=$(git rev-parse "$fullname")
Expand All @@ -68,9 +68,9 @@ cmd_list() {
typeset tagname=$(git name-rev --tags --no-undefined --name-only $base)
typeset nicename
if [ "$tagname" != "" ]; then
nicename="$tagname"
nicename=$tagname
else
nicename="$(git rev-parse --short $base)"
nicename=$(git rev-parse --short $base)
fi
printf "(based on $nicename)"
fi
Expand All @@ -92,7 +92,7 @@ parse_args() {
eval set -- "${FLAGS_ARGV}"

# read arguments into global variables
VERSION="$1"
VERSION=$1
BRANCH=$PREFIX$VERSION
}

Expand All @@ -115,7 +115,7 @@ require_base_is_on_master() {
cmd_start() {
DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F
parse_args "$@"
BASE="${2:-$MASTER_BRANCH}"
BASE=${2:-$MASTER_BRANCH}
require_version_arg
require_base_is_on_master

Expand Down
12 changes: 6 additions & 6 deletions git-flow-release
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ cmd_list() {
typeset release_branches
typeset current_branch
typeset short_names
release_branches="$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")"
release_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
if [ -z "$release_branches" ]; then
warn "No release branches exist."
exit 0
Expand All @@ -63,7 +63,7 @@ cmd_list() {

typeset branch
for branch in $short_names; do
typeset fullname="$PREFIX$branch"
typeset fullname=$PREFIX$branch
typeset base=$(git merge-base "$fullname" "$DEVELOP_BRANCH")
typeset develop_sha=$(git rev-parse "$DEVELOP_BRANCH")
typeset branch_sha=$(git rev-parse "$fullname")
Expand All @@ -77,7 +77,7 @@ cmd_list() {
if [ "$branch_sha" = "$develop_sha" ]; then
printf "(no commits yet)"
else
typeset nicename="$(git rev-parse --short $base)"
typeset nicename=$(git rev-parse --short $base)
printf "(based on $nicename)"
fi
else
Expand All @@ -98,8 +98,8 @@ parse_args() {
eval set -- "${FLAGS_ARGV}"

# read arguments into global variables
VERSION="$1"
BRANCH="$PREFIX$VERSION"
VERSION=$1
BRANCH=$PREFIX$VERSION
}

require_version_arg() {
Expand All @@ -121,7 +121,7 @@ require_base_is_on_develop() {
cmd_start() {
DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F
parse_args "$@"
BASE="${2:-$DEVELOP_BRANCH}"
BASE=${2:-$DEVELOP_BRANCH}
require_version_arg
require_base_is_on_develop

Expand Down
12 changes: 6 additions & 6 deletions git-flow-support
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cmd_list() {
typeset support_branches
typeset current_branch
typeset short_names
support_branches="$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")"
support_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
if [ -z "$support_branches" ]; then
warn "No support branches exist."
exit 0
Expand All @@ -53,7 +53,7 @@ cmd_list() {

typeset branch
for branch in $short_names; do
typeset fullname="$PREFIX$branch"
typeset fullname=$PREFIX$branch
typeset base=$(git merge-base "$fullname" "$MASTER_BRANCH")
typeset master_sha=$(git rev-parse "$MASTER_BRANCH")
typeset branch_sha=$(git rev-parse "$fullname")
Expand All @@ -70,9 +70,9 @@ cmd_list() {
typeset tagname=$(git name-rev --tags --no-undefined --name-only $base)
typeset nicename
if [ "$tagname" != "" ]; then
nicename="$tagname"
nicename=$tagname
else
nicename="$(git rev-parse --short $base)"
nicename=$(git rev-parse --short $base)
fi
printf "(based on $nicename)"
fi
Expand All @@ -94,8 +94,8 @@ parse_args() {
eval set -- "${FLAGS_ARGV}"

# read arguments into global variables
VERSION="$1"
BASE="$2"
VERSION=$1
BASE=$2
BRANCH=$PREFIX$VERSION
}

Expand Down
6 changes: 3 additions & 3 deletions gitflow-common
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ ALL_TAGS=$(git tag)
# 2: Multiple matches found. These matches are written to stderr
#
resolve_nameprefix() {
typeset name="$1"
typeset prefix="$2"
typeset name=$1
typeset prefix=$2
typeset matches
typeset -i num_matches

Expand All @@ -72,7 +72,7 @@ resolve_nameprefix() {
return 0
fi

matches="$(echo "$LOCAL_BRANCHES" | grep "^$prefix$name")"
matches=$(echo "$LOCAL_BRANCHES" | grep "^$prefix$name")
num_matches=$(echo "$matches" | wc -l)
if [ -z "$matches" ]; then
# no prefix match, so take it literally
Expand Down

0 comments on commit c5fcc01

Please sign in to comment.