* [PATCH] t1501: don't reassign EMPTY_BLOB and EMPTY_TREE
@ 2026-11-24 9:15 René Scharfe
2026-11-24 12:51 ` Ben Knoble
2026-11-24 20:29 ` Junio C Hamano
0 siblings, 2 replies; 4+ messages in thread
From: René Scharfe @ 2026-11-24 9:15 UTC (permalink / raw)
To: Git List
The variables EMPTY_BLOB AND EMPTY_TREE are already set by test-lib.sh,
so just use them.
Signed-off-by: René Scharfe <l.s.r@web.de>
---
t/t1501-work-tree.sh | 2 --
1 file changed, 2 deletions(-)
diff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh
index 8c94ac2e70..e6f43b0fb8 100755
--- a/t/t1501-work-tree.sh
+++ b/t/t1501-work-tree.sh
@@ -5,8 +5,6 @@ test_description='test separate work tree'
. ./test-lib.sh
test_expect_success 'setup' '
- EMPTY_TREE=$(git write-tree) &&
- EMPTY_BLOB=$(git hash-object -t blob --stdin </dev/null) &&
CHANGED_BLOB=$(echo changed | git hash-object -t blob --stdin) &&
EMPTY_BLOB7=$(echo $EMPTY_BLOB | sed "s/\(.......\).*/\1/") &&
CHANGED_BLOB7=$(echo $CHANGED_BLOB | sed "s/\(.......\).*/\1/") &&
--
2.56.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] t1501: don't reassign EMPTY_BLOB and EMPTY_TREE
2026-11-24 9:15 [PATCH] t1501: don't reassign EMPTY_BLOB and EMPTY_TREE René Scharfe
@ 2026-11-24 12:51 ` Ben Knoble
2026-11-25 11:39 ` René Scharfe
2026-11-24 20:29 ` Junio C Hamano
1 sibling, 1 reply; 4+ messages in thread
From: Ben Knoble @ 2026-11-24 12:51 UTC (permalink / raw)
To: René Scharfe; +Cc: Git List
> Le 24 nov. 2026 à 04:16, René Scharfe <l.s.r@web.de> a écrit :
>
> The variables EMPTY_BLOB AND EMPTY_TREE are already set by test-lib.sh,
> so just use them.
Nit: downcase and?
>
> Signed-off-by: René Scharfe <l.s.r@web.de>
> ---
> t/t1501-work-tree.sh | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh
> index 8c94ac2e70..e6f43b0fb8 100755
> --- a/t/t1501-work-tree.sh
> +++ b/t/t1501-work-tree.sh
> @@ -5,8 +5,6 @@ test_description='test separate work tree'
> . ./test-lib.sh
>
> test_expect_success 'setup' '
> - EMPTY_TREE=$(git write-tree) &&
> - EMPTY_BLOB=$(git hash-object -t blob --stdin </dev/null) &&
> CHANGED_BLOB=$(echo changed | git hash-object -t blob --stdin) &&
> EMPTY_BLOB7=$(echo $EMPTY_BLOB | sed "s/\(.......\).*/\1/") &&
> CHANGED_BLOB7=$(echo $CHANGED_BLOB | sed "s/\(.......\).*/\1/") &&
> --
> 2.56.1
Nice simplification. A future reader may wonder what sets those,
but git-grep turns them up.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] t1501: don't reassign EMPTY_BLOB and EMPTY_TREE
2026-11-24 9:15 [PATCH] t1501: don't reassign EMPTY_BLOB and EMPTY_TREE René Scharfe
2026-11-24 12:51 ` Ben Knoble
@ 2026-11-24 20:29 ` Junio C Hamano
1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2026-11-24 20:29 UTC (permalink / raw)
To: René Scharfe; +Cc: Git List
René Scharfe <l.s.r@web.de> writes:
> The variables EMPTY_BLOB AND EMPTY_TREE are already set by test-lib.sh,
> so just use them.
>
> Signed-off-by: René Scharfe <l.s.r@web.de>
> ---
> t/t1501-work-tree.sh | 2 --
> 1 file changed, 2 deletions(-)
Nice spotting. Even though the version in test-lib.sh has a certain
"Yuck" factor by relying on hardcoded values in oid-info/hash-info file,
we already rely on them everywhere, so there is no good excuse not to
use them.
Will queue. Thanks.
> diff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh
> index 8c94ac2e70..e6f43b0fb8 100755
> --- a/t/t1501-work-tree.sh
> +++ b/t/t1501-work-tree.sh
> @@ -5,8 +5,6 @@ test_description='test separate work tree'
> . ./test-lib.sh
>
> test_expect_success 'setup' '
> - EMPTY_TREE=$(git write-tree) &&
> - EMPTY_BLOB=$(git hash-object -t blob --stdin </dev/null) &&
> CHANGED_BLOB=$(echo changed | git hash-object -t blob --stdin) &&
> EMPTY_BLOB7=$(echo $EMPTY_BLOB | sed "s/\(.......\).*/\1/") &&
> CHANGED_BLOB7=$(echo $CHANGED_BLOB | sed "s/\(.......\).*/\1/") &&
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] t1501: don't reassign EMPTY_BLOB and EMPTY_TREE
2026-11-24 12:51 ` Ben Knoble
@ 2026-11-25 11:39 ` René Scharfe
0 siblings, 0 replies; 4+ messages in thread
From: René Scharfe @ 2026-11-25 11:39 UTC (permalink / raw)
To: Ben Knoble; +Cc: Git List
On 11/24/26 1:51 PM, Ben Knoble wrote:
>
>> Le 24 nov. 2026 à 04:16, René Scharfe <l.s.r@web.de> a écrit :
>>
>> The variables EMPTY_BLOB AND EMPTY_TREE are already set by test-lib.sh,
>> so just use them.
>
> Nit: downcase and?
Right, no need to shout the conjunction..
René
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-25 11:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 9:15 [PATCH] t1501: don't reassign EMPTY_BLOB and EMPTY_TREE René Scharfe
2026-11-24 12:51 ` Ben Knoble
2026-11-25 11:39 ` René Scharfe
2026-11-24 20:29 ` 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