Thread (2 messages) 2 messages, 2 authors, 2025-09-22

Re: [PATCH 1/6] stash: tell setup_revisions() to free our allocated strings

From: Junio C Hamano <hidden>
Date: 2025-09-22 19:36:25

Possibly related (same subject, not in this thread)

Jeff King [off-list ref] writes:
Yeah, I had originally written just:

  test_expect_success 'stash show -- does not leak' '
	git stash show --
  '

but it felt funny, since the test is doing nothing in a build without
SANITIZE=leak. If we are OK with that funniness, I can switch back to
that.
We have a prerequisite for that.  Very nice vehicle for
documentation purposes, even though we do not care about a single
"stash show" invocation for correctness or performance reasons.

Perhaps I can squash the following in, unless you have other changes
in mind.

 t/t3903-stash.sh | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git c/t/t3903-stash.sh w/t/t3903-stash.sh
index 7ebeb057d3..930c31e547 100755
--- c/t/t3903-stash.sh
+++ w/t/t3903-stash.sh
@@ -1741,10 +1741,8 @@ test_expect_success 'submodules does not affect the branch recorded in stash mes
 	)
 '
 
-test_expect_success 'stash show handles --' '
-	git stash show >expect &&
-	git stash show -- >actual &&
-	test_cmp expect actual
+test_expect_success SANITIZE_LEAK 'stash show handles -- without leaking' '
+	git stash show --
 '
 
 test_expect_success 'controlled error return on unrecognized option' '
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help