git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t1400: fix --no-create-reflog test and description
@ 2024-10-20 16:12 kristofferhaugsbakk
  2024-10-21 12:08 ` Patrick Steinhardt
  2024-11-07 12:11 ` Kristoffer Haugsbakk
  0 siblings, 2 replies; 8+ messages in thread
From: kristofferhaugsbakk @ 2024-10-20 16:12 UTC (permalink / raw)
  To: git; +Cc: Kristoffer Haugsbakk

From: Kristoffer Haugsbakk <code@khaugsbakk.name>

This test has had the wrong title since it was created.[1]  Use `always`
like the description says and negate the expected outcome.

The test works since `core.logAllRefUpdates` set to `true` does not
create a reflog for that ref namespace.  So the test is testing the
config variable, not the option.

The test itself is fine and does not hide a bug: `--no-create-reflog` is
not supposed to override `core.logAllRefUpdates`.

† 1: 341fb286212 (refs: add option core.logAllRefUpdates = always,
    2017-01-27)

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
---

Notes (series):
    From the commit message:
    
      “ The test itself is fine and does not hide a bug:
        `--no-create-reflog` is not supposed to override
    
    A source for that: roundabout through git-branch(1):
    
      “ The negated form --no-create-reflog only overrides an earlier
        --create-reflog, but currently does not negate the setting of
        core.logAllRefUpdates.
    
    I *suppose* that the same applies to update-ref since (I suppose) they
    use the same underlying machinery.
    
    See also git-tag(1) which says the same thing.
    
    update-ref should document the same thing, then.  I have that marked as
    a todo item.  The changes there are a bit too involved to implicate in
    this submission.

 t/t1400-update-ref.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index eb1691860da..9bf87db4775 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -169,14 +169,14 @@ test_expect_success 'core.logAllRefUpdates=always creates reflog for ORIG_HEAD'
 	git reflog exists ORIG_HEAD
 '
 
-test_expect_success '--no-create-reflog overrides core.logAllRefUpdates=always' '
-	test_config core.logAllRefUpdates true &&
+test_expect_success '--no-create-reflog does not override core.logAllRefUpdates=always' '
+	test_config core.logAllRefUpdates always &&
 	test_when_finished "git update-ref -d $outside" &&
 	git update-ref --no-create-reflog $outside $A &&
 	git rev-parse $A >expect &&
 	git rev-parse $outside >actual &&
 	test_cmp expect actual &&
-	test_must_fail git reflog exists $outside
+	git reflog exists $outside
 '
 
 test_expect_success "create $m (by HEAD)" '

base-commit: 34b6ce9b30747131b6e781ff718a45328aa887d0
-- 
2.46.1.641.g54e7913fcb6


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-11-08  3:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-20 16:12 [PATCH] t1400: fix --no-create-reflog test and description kristofferhaugsbakk
2024-10-21 12:08 ` Patrick Steinhardt
2024-10-21 16:48   ` Kristoffer Haugsbakk
2024-10-21 19:02     ` Taylor Blau
2024-10-21 21:02       ` Kristoffer Haugsbakk
2024-10-21 21:10         ` Taylor Blau
2024-11-07 12:11 ` Kristoffer Haugsbakk
2024-11-08  3:13   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).