From 8fcaca3ff29a193f50a44bb3d5734a503e0539a6 Mon Sep 17 00:00:00 2001 From: Dave Olszewski Date: Sat, 13 Mar 2010 14:47:05 -0800 Subject: don't use default revision if a rev was specified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a revision is specified, it happens not to have any commits, don't use the default revision. By doing so, surprising and undesired behavior can happen, such as showing the reflog for HEAD when a branch was specified. [jc: squashed a test from René] Signed-off-by: Dave Olszewski Signed-off-by: Junio C Hamano --- t/t1411-reflog-show.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 't') diff --git a/t/t1411-reflog-show.sh b/t/t1411-reflog-show.sh index c18ed8edf..ba25ff354 100755 --- a/t/t1411-reflog-show.sh +++ b/t/t1411-reflog-show.sh @@ -64,4 +64,13 @@ test_expect_success 'using --date= shows reflog date (oneline)' ' test_cmp expect actual ' +: >expect +test_expect_success 'empty reflog file' ' + git branch empty && + : >.git/logs/refs/heads/empty && + + git log -g empty >actual && + test_cmp expect actual +' + test_done -- cgit v1.2.1