From: Junio C Hamano Date: Mon, 8 Jan 2007 10:44:55 +0000 (-0800) Subject: git-checkout: fix branch name output from the command X-Git-Tag: v1.5.0-rc1~5^2~2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=8d78b5af2376be533ed11b53b292bdf0f2e6173b;p=git.git 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 --- diff --git a/git-checkout.sh b/git-checkout.sh index 69d0c1c43..a309bf0a1 100755 --- a/git-checkout.sh +++ b/git-checkout.sh @@ -53,7 +53,7 @@ while [ "$#" != "0" ]; do exit 1 fi new="$rev" - new_name="$arg^0" + new_name="$arg" if git-show-ref --verify --quiet -- "refs/heads/$arg" then branch="$arg" diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index a6ea0f6a1..bb80e4286 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -48,7 +48,7 @@ test_expect_success \ test ! -f .git/logs/refs/heads/d/e/f' cat >expect < 1117150200 +0000 checkout: Created from master^0 +0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 checkout: Created from master EOF test_expect_success \ 'git checkout -b g/h/i -l should create a branch and a log' \