Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
t0002: abstract away SHA-1 specific constants
author
brian m. carlson
<sandals@crustytoothpaste.net>
Thu, 13 Sep 2018 05:17:34 +0000
(
05:17
+0000)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 13 Sep 2018 21:15:24 +0000
(14:15 -0700)
Adjust the test so that it computes variables for object IDs instead of
using hard-coded hashes.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0002-gitfile.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
e483e14
)
diff --git
a/t/t0002-gitfile.sh
b/t/t0002-gitfile.sh
index 3691023d510a0d97bf1390b781afe1ac9fa270f4..0aa9908ea12d7592841e10ac09afe8b36f37ce7f 100755
(executable)
--- a/
t/t0002-gitfile.sh
+++ b/
t/t0002-gitfile.sh
@@
-92,11
+92,12
@@
test_expect_success 'enter_repo non-strict mode' '
mv .git .realgit &&
echo "gitdir: .realgit" >.git
) &&
mv .git .realgit &&
echo "gitdir: .realgit" >.git
) &&
+ head=$(git -C enter_repo rev-parse HEAD) &&
git ls-remote enter_repo >actual &&
git ls-remote enter_repo >actual &&
- cat >expected <<-
\
EOF &&
-
946e985ab20de757ca5b872b16d64e92ff3803a9
HEAD
-
946e985ab20de757ca5b872b16d64e92ff3803a9
refs/heads/master
-
946e985ab20de757ca5b872b16d64e92ff3803a9
refs/tags/foo
+ cat >expected <<-EOF &&
+
$head
HEAD
+
$head
refs/heads/master
+
$head
refs/tags/foo
EOF
test_cmp expected actual
'
EOF
test_cmp expected actual
'
@@
-106,21
+107,23
@@
test_expect_success 'enter_repo linked checkout' '
cd enter_repo &&
git worktree add ../foo refs/tags/foo
) &&
cd enter_repo &&
git worktree add ../foo refs/tags/foo
) &&
+ head=$(git -C enter_repo rev-parse HEAD) &&
git ls-remote foo >actual &&
git ls-remote foo >actual &&
- cat >expected <<-
\
EOF &&
-
946e985ab20de757ca5b872b16d64e92ff3803a9
HEAD
-
946e985ab20de757ca5b872b16d64e92ff3803a9
refs/heads/master
-
946e985ab20de757ca5b872b16d64e92ff3803a9
refs/tags/foo
+ cat >expected <<-EOF &&
+
$head
HEAD
+
$head
refs/heads/master
+
$head
refs/tags/foo
EOF
test_cmp expected actual
'
test_expect_success 'enter_repo strict mode' '
EOF
test_cmp expected actual
'
test_expect_success 'enter_repo strict mode' '
+ head=$(git -C enter_repo rev-parse HEAD) &&
git ls-remote --upload-pack="git upload-pack --strict" foo/.git >actual &&
git ls-remote --upload-pack="git upload-pack --strict" foo/.git >actual &&
- cat >expected <<-
\
EOF &&
-
946e985ab20de757ca5b872b16d64e92ff3803a9
HEAD
-
946e985ab20de757ca5b872b16d64e92ff3803a9
refs/heads/master
-
946e985ab20de757ca5b872b16d64e92ff3803a9
refs/tags/foo
+ cat >expected <<-EOF &&
+
$head
HEAD
+
$head
refs/heads/master
+
$head
refs/tags/foo
EOF
test_cmp expected actual
'
EOF
test_cmp expected actual
'