summaryrefslogtreecommitdiff
path: root/git-checkout.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-checkout.sh')
-rwxr-xr-xgit-checkout.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/git-checkout.sh b/git-checkout.sh
index a7390e8..ed7c2c5 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -17,6 +17,7 @@ newbranch=
newbranch_log=
merge=
quiet=
+v=-v
LF='
'
while [ "$#" != "0" ]; do
@@ -47,6 +48,7 @@ while [ "$#" != "0" ]; do
;;
"-q")
quiet=1
+ v=
;;
--)
break
@@ -170,7 +172,7 @@ describe_detached_head () {
}
}
-if test -z "$branch$newbranch" && test "$new" != "$old"
+if test -z "$branch$newbranch" && test "$new_name" != "$old_name"
then
detached="$new"
if test -n "$oldbranch" && test -z "$quiet"
@@ -180,7 +182,7 @@ If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
git checkout -b <new_branch_name>"
fi
-elif test -z "$oldbranch"
+elif test -z "$oldbranch" && test "$new" != "$old"
then
describe_detached_head 'Previous HEAD position was' "$old"
fi
@@ -197,7 +199,7 @@ fi
if [ "$force" ]
then
- git-read-tree --reset -u $new
+ git-read-tree $v --reset -u $new
else
git-update-index --refresh >/dev/null
merge_error=$(git-read-tree -m -u --exclude-per-directory=.gitignore $old $new 2>&1) || (
@@ -210,7 +212,7 @@ else
# Match the index to the working tree, and do a three-way.
git diff-files --name-only | git update-index --remove --stdin &&
work=`git write-tree` &&
- git read-tree --reset -u $new || exit
+ git read-tree $v --reset -u $new || exit
eval GITHEAD_$new='${new_name:-${branch:-$new}}' &&
eval GITHEAD_$work=local &&
@@ -221,7 +223,7 @@ else
# this is not a real merge before committing, but just carrying
# the working tree changes along.
unmerged=`git ls-files -u`
- git read-tree --reset $new
+ git read-tree $v --reset $new
case "$unmerged" in
'') ;;
*)