* [PATCH] Remove bashism from t3210-pack-refs.sh
@ 2006-10-06 9:10 Dennis Stosberg
2006-10-06 13:35 ` Alex Riesen
0 siblings, 1 reply; 4+ messages in thread
From: Dennis Stosberg @ 2006-10-06 9:10 UTC (permalink / raw)
To: git
This bashism makes the test fail if /bin/sh is not bash.
Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
---
t/t3210-pack-refs.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
index f31e79c..ca5bd49 100755
--- a/t/t3210-pack-refs.sh
+++ b/t/t3210-pack-refs.sh
@@ -23,7 +23,7 @@ SHA1=
test_expect_success \
'see if git show-ref works as expected' \
'git-branch a &&
- SHA1=$(< .git/refs/heads/a) &&
+ SHA1=`cat .git/refs/heads/a` &&
echo "$SHA1 refs/heads/a" >expect &&
git-show-ref a >result &&
diff expect result'
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove bashism from t3210-pack-refs.sh
2006-10-06 9:10 [PATCH] Remove bashism from t3210-pack-refs.sh Dennis Stosberg
@ 2006-10-06 13:35 ` Alex Riesen
2006-10-06 15:05 ` Jakub Narebski
0 siblings, 1 reply; 4+ messages in thread
From: Alex Riesen @ 2006-10-06 13:35 UTC (permalink / raw)
To: Dennis Stosberg; +Cc: git
On 10/6/06, Dennis Stosberg <dennis@stosberg.net> wrote:
> - SHA1=$(< .git/refs/heads/a) &&
> + SHA1=`cat .git/refs/heads/a` &&
Only "<" (the redirection part) is bashism. The "$()" is POSIX.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove bashism from t3210-pack-refs.sh
2006-10-06 13:35 ` Alex Riesen
@ 2006-10-06 15:05 ` Jakub Narebski
2006-10-06 16:33 ` Linus Torvalds
0 siblings, 1 reply; 4+ messages in thread
From: Jakub Narebski @ 2006-10-06 15:05 UTC (permalink / raw)
To: git
Alex Riesen wrote:
> On 10/6/06, Dennis Stosberg <dennis@stosberg.net> wrote:
>> - SHA1=$(< .git/refs/heads/a) &&
>> + SHA1=`cat .git/refs/heads/a` &&
>
> Only "<" (the redirection part) is bashism. The "$()" is POSIX.
BTW. it is not packed-refs safe.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Remove bashism from t3210-pack-refs.sh
2006-10-06 15:05 ` Jakub Narebski
@ 2006-10-06 16:33 ` Linus Torvalds
0 siblings, 0 replies; 4+ messages in thread
From: Linus Torvalds @ 2006-10-06 16:33 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
On Fri, 6 Oct 2006, Jakub Narebski wrote:
> Alex Riesen wrote:
>
> > On 10/6/06, Dennis Stosberg <dennis@stosberg.net> wrote:
> >> - SHA1=$(< .git/refs/heads/a) &&
> >> + SHA1=`cat .git/refs/heads/a` &&
> >
> > Only "<" (the redirection part) is bashism. The "$()" is POSIX.
>
> BTW. it is not packed-refs safe.
Well, since that seems to be a test-case for the packed-refs thing, that's
probably not a problem ;)
In a real-life git script you should do something like
SHA1=$(git-rev-parse --verify "refs/heads/$head^0") && ...
to get the SHA1 and verify that it's all good, but since that script is
all about checking that packing does the right thing, I think it's fine to
do it by hand there..
Linus
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-10-06 16:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-06 9:10 [PATCH] Remove bashism from t3210-pack-refs.sh Dennis Stosberg
2006-10-06 13:35 ` Alex Riesen
2006-10-06 15:05 ` Jakub Narebski
2006-10-06 16:33 ` Linus Torvalds
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).