summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b1edaf6)
raw | patch | inline | side by side (parent: b1edaf6)
author | Junio C Hamano <gitster@pobox.com> | |
Wed, 21 Jul 2010 19:47:48 +0000 (12:47 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 21 Jul 2010 19:54:48 +0000 (12:54 -0700) |
These two tests weren't about how "git reflog show <branch>" exits when
there is no reflog, but were about "checkout" and "branch" create or not
create reflog when creating a new <branch>. Update the tests to check
what we are interested in, using "git rev-parse --verify".
Also lose tests based on "test -f .git/logs/refs/heads/<branch>" from
nearby, to avoid exposing this particular implementation detail
unnecessarily.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
there is no reflog, but were about "checkout" and "branch" create or not
create reflog when creating a new <branch>. Update the tests to check
what we are interested in, using "git rev-parse --verify".
Also lose tests based on "test -f .git/logs/refs/heads/<branch>" from
nearby, to avoid exposing this particular implementation detail
unnecessarily.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t2017-checkout-orphan.sh | patch | blob | history | |
t/t3200-branch.sh | patch | blob | history |
index 81cb393a95a3e3b0a172b6016d32cade8dbafdb4..2d2f63f22ee59d8dc24dafaa5224928ad62dea0c 100755 (executable)
git checkout master &&
git config --unset core.logAllRefUpdates &&
git checkout --orphan delta &&
- ! test -f .git/logs/refs/heads/delta &&
- (
- PAGER= &&
- export PAGER &&
- test_must_fail git reflog show delta
- ) &&
+ test_must_fail git rev-parse --verify delta@{0} &&
git commit -m Delta &&
- test -f .git/logs/refs/heads/delta &&
- PAGER= git reflog show delta
+ git rev-parse --verify delta@{0}
'
test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '
git checkout master &&
git config core.logAllRefUpdates false &&
git checkout --orphan epsilon &&
- ! test -f .git/logs/refs/heads/epsilon &&
- (
- PAGER= &&
- export PAGER &&
- test_must_fail git reflog show epsilon
- ) &&
+ test_must_fail git rev-parse --verify epsilon@{0} &&
git commit -m Epsilon &&
- ! test -f .git/logs/refs/heads/epsilon &&
- (
- PAGER= &&
- export PAGER &&
- test_must_fail git reflog show epsilon
- )
+ test_must_fail git rev-parse --verify epsilon@{0}
'
test_expect_success '--orphan with -l makes reflog when core.logAllRefUpdates = false' '
git checkout master &&
git checkout -l --orphan zeta &&
- test -f .git/logs/refs/heads/zeta &&
- (
- PAGER= &&
- export PAGER &&
- test_must_fail git reflog show zeta
- ) &&
+ test_must_fail git rev-parse --verify zeta@{0} &&
git commit -m Zeta &&
- PAGER= git reflog show zeta
+ git rev-parse --verify zeta@{0}
'
test_expect_success 'giving up --orphan not committed when -l and core.logAllRefUpdates = false deletes reflog' '
git checkout master &&
git checkout -l --orphan eta &&
- test -f .git/logs/refs/heads/eta &&
- (
- PAGER= &&
- export PAGER &&
- test_must_fail git reflog show eta
- ) &&
+ test_must_fail git rev-parse --verify eta@{0} &&
git checkout master &&
- ! test -f .git/logs/refs/heads/eta &&
- (
- PAGER= &&
- export PAGER &&
- test_must_fail git reflog show eta
- )
+ test_must_fail git rev-parse --verify eta@{0}
'
test_expect_success '--orphan is rejected with an existing name' '
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index bf7747dc331995fe377d4943f450ea295375565e..f54a533456d74a3eb2f745dbc77c8ad5a5ae960f 100755 (executable)
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
git checkout master &&
git config --unset core.logAllRefUpdates &&
git checkout -b alpha &&
- test -f .git/logs/refs/heads/alpha &&
- PAGER= git reflog show alpha
+ git rev-parse --verify alpha@{0}
'
test_expect_success 'checkout -b does not make reflog when core.logAllRefUpdates = false' '
git checkout master &&
git config core.logAllRefUpdates false &&
git checkout -b beta &&
- ! test -f .git/logs/refs/heads/beta &&
- (
- PAGER= &&
- export PAGER &&
- test_must_fail git reflog show beta
- )
+ test_must_fail git rev-parse --verify beta@{0}
'
test_expect_success 'checkout -b with -l makes reflog when core.logAllRefUpdates = false' '
git checkout master &&
git checkout -lb gamma &&
git config --unset core.logAllRefUpdates &&
- test -f .git/logs/refs/heads/gamma &&
- PAGER= git reflog show gamma
+ git rev-parse --verify gamma@{0}
'
test_expect_success 'avoid ambiguous track' '