Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Herland <johan@herland.net>2009-08-20 13:24:54 +0400
committerJunio C Hamano <gitster@pobox.com>2009-08-21 03:59:45 +0400
commite3ae4a8613151c93ffce78c674ac91c1ee34eef6 (patch)
tree222f81a36f906ba46d8f8243c2b544f294e8819c /t/t7407-submodule-foreach.sh
parent64b19ffeddda499e7380b38b43a3dee579734905 (diff)
t7407: Use 'rev-parse --short' rather than bash's substring expansion notation
The substring expansion notation is a bashism that we have not so far adopted. Use 'git rev-parse --short' instead, as this also handles the case where the unique abbreviation is longer than 7 characters. Also fix the typo; the object name for submodule #2 was copied from submodule #1's by mistake. Suggested-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7407-submodule-foreach.sh')
-rwxr-xr-xt/t7407-submodule-foreach.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index de1730d638..519db49ea6 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -201,14 +201,16 @@ submodulesha1=$(cd clone3/nested1/nested2/nested3/submodule && git rev-parse HEA
sub1sha1=$(cd clone3/sub1 && git rev-parse HEAD)
sub2sha1=$(cd clone3/sub2 && git rev-parse HEAD)
sub3sha1=$(cd clone3/sub3 && git rev-parse HEAD)
+sub1sha1_short=$(cd clone3/sub1 && git rev-parse --short HEAD)
+sub2sha1_short=$(cd clone3/sub2 && git rev-parse --short HEAD)
cat > expect <<EOF
$nested1sha1 nested1 (heads/master)
$nested2sha1 nested1/nested2 (heads/master)
$nested3sha1 nested1/nested2/nested3 (heads/master)
$submodulesha1 nested1/nested2/nested3/submodule (heads/master)
- $sub1sha1 sub1 (${sub1sha1:0:7})
- $sub2sha1 sub2 (${sub1sha1:0:7})
+ $sub1sha1 sub1 ($sub1sha1_short)
+ $sub2sha1 sub2 ($sub2sha1_short)
$sub3sha1 sub3 (heads/master)
EOF