git-checkout: fix branch name output from the command

When switching branches with "git checkout", we internally did $arg^0
(aka $arg^{commit}) suffix but there was no need to.

The improvement is easily visible in the change to an existing
test t/3200-branch.sh in this commit; it was expecting rather
ugly message.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2007-01-08 02:44:55 -08:00
parent ead80606d4
commit 8d78b5af23
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ while [ "$#" != "0" ]; do
exit 1 exit 1
fi fi
new="$rev" new="$rev"
new_name="$arg^0" new_name="$arg"
if git-show-ref --verify --quiet -- "refs/heads/$arg" if git-show-ref --verify --quiet -- "refs/heads/$arg"
then then
branch="$arg" branch="$arg"

View File

@ -48,7 +48,7 @@ test_expect_success \
test ! -f .git/logs/refs/heads/d/e/f' test ! -f .git/logs/refs/heads/d/e/f'
cat >expect <<EOF cat >expect <<EOF
0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 checkout: Created from master^0 0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 checkout: Created from master
EOF EOF
test_expect_success \ test_expect_success \
'git checkout -b g/h/i -l should create a branch and a log' \ 'git checkout -b g/h/i -l should create a branch and a log' \