summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-09-08 20:23:13 -0500
committerJunio C Hamano <gitster@pobox.com>2013-09-10 14:34:52 -0700
commit6ed6421b28c39dade1a2de79de4f36970ca34c07 (patch)
treebb5dbea1390fcbae2d0fea88558e251f2537cab8
parentff0d73b8f6dd20207bf91d3395c20a3423dfb2b0 (diff)
downloadgit-6ed6421b28c39dade1a2de79de4f36970ca34c07.tar.gz
pull: refactor $rebase variable into $mode
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-pull.sh22
1 files changed, 11 insertions, 11 deletions
diff --git a/git-pull.sh b/git-pull.sh
index de57c1d9b0..f53d1937b5 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -48,8 +48,7 @@ if test -z "$mode"
then
mode=$(git config pull.mode)
fi
-test "$mode" == 'rebase' && rebase="true"
-if test -z "$rebase"
+if test -z "$mode"
then
rebase=$(git config --bool branch.$curr_branch_short.rebase)
if test -z "$rebase"
@@ -58,6 +57,7 @@ then
fi
if test "$rebase" = 'true'
then
+ mode="rebase"
echo "The configurations pull.rebase and branch.<name>.rebase are deprecated."
echo "Please use pull.mode and branch.<name>.pullmode instead."
fi
@@ -125,10 +125,10 @@ do
merge_args="$merge_args$xx "
;;
-r|--r|--re|--reb|--reba|--rebas|--rebase)
- rebase=true
+ mode=rebase
;;
--no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)
- rebase=false
+ mode=
;;
--recurse-submodules)
recurse_submodules=--recurse-submodules
@@ -171,7 +171,7 @@ error_on_no_merge_candidates () {
esac
done
- if test true = "$rebase"
+ if test "$mode" = rebase
then
op_type=rebase
op_prep=against
@@ -185,7 +185,7 @@ error_on_no_merge_candidates () {
remote=$(git config "branch.$curr_branch.remote")
if [ $# -gt 1 ]; then
- if [ "$rebase" = true ]; then
+ if [ "$mode" = rebase ]; then
printf "There is no candidate for rebasing against "
else
printf "There are no candidates for merging "
@@ -208,7 +208,7 @@ error_on_no_merge_candidates () {
exit 1
}
-test true = "$rebase" && {
+test "$mode" = rebase && {
if ! git rev-parse -q --verify HEAD >/dev/null
then
# On an unborn branch
@@ -273,7 +273,7 @@ case "$merge_head" in
then
die "$(gettext "Cannot merge multiple branches into empty head")"
fi
- if test true = "$rebase"
+ if test "$mode" = rebase
then
die "$(gettext "Cannot rebase onto multiple branches")"
fi
@@ -294,7 +294,7 @@ then
exit
fi
-if test true = "$rebase"
+if test "$mode" = rebase
then
o=$(git show-branch --merge-base $curr_branch $merge_head $oldremoteref)
if test "$oldremoteref" = "$o"
@@ -304,8 +304,8 @@ then
fi
merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit
-case "$rebase" in
-true)
+case "$mode" in
+rebase)
eval="git-rebase $diffstat $strategy_args $merge_args $verbosity"
eval="$eval --onto $merge_head ${oldremoteref:-$merge_head}"
;;