From: Nanako Shiraishi Date: Sun, 17 May 2009 02:43:08 GMT Subject: [PATCH] test: checkout shouldn't say that HEAD has moved if it didn't Message-ID: <20090517114308.6117@nanako3.lavabit.com> In-Reply-To: <7vr5yolt1j.fsf@alter.siamese.dyndns.org> Signed-off-by: しらいしななこ --- Quoting Junio C Hamano : > Daniel Cordero writes: > >> Previously, checkout would tell the user this message before moving HEAD, >> without regard to whether the upcoming move will result in success. >> If the move failed, this causes confusion. >> >> Show the message after the move, unless the move failed. >> >> Signed-off-by: Daniel Cordero > > Thanks; the patch looks obviously good. Can we have tests? Here is one. t/t7201-co.sh | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/t/t7201-co.sh b/t/t7201-co.sh index bdb808a..ebfd34d 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -534,4 +534,12 @@ test_expect_success 'failing checkout -b should not break working tree' ' ' +test_expect_success 'switch out of non-branch' ' + git reset --hard master && + git checkout master^0 && + echo modified >one && + test_must_fail git checkout renamer 2>error.log && + ! grep "^Previous HEAD" error.log +' + test_done -- Nanako Shiraishi http://ivory.ap.teacup.com/nanako3/