summaryrefslogtreecommitdiff
path: root/t/t9300-fast-import.sh
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-01-18 19:49:05 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-01-18 19:49:05 (GMT)
commit8232dc427fb4b92b38e74e9e93b52231a67e354f (patch)
tree64bd97e976c9af26595ec75573d1ec9cc7daf183 /t/t9300-fast-import.sh
parent50aee995121a103fe2698574e7f1d56660a5b89b (diff)
downloadgit-8232dc427fb4b92b38e74e9e93b52231a67e354f.zip
git-8232dc427fb4b92b38e74e9e93b52231a67e354f.tar.gz
git-8232dc427fb4b92b38e74e9e93b52231a67e354f.tar.bz2
Reduce value duplication in t9300-fast-import.
It is error prone to list the value of each file twice, instead we should list the value only once early in the script and reuse the shell variable when we need to access it. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 't/t9300-fast-import.sh')
-rwxr-xr-xt/t9300-fast-import.sh34
1 files changed, 17 insertions, 17 deletions
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 1463476..40b8c07 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -7,6 +7,16 @@ test_description='test git-fast-import utility'
. ./test-lib.sh
. ../diff-lib.sh ;# test-lib chdir's into trash
+file2_data='file2
+second line of EOF'
+
+file3_data='EOF
+in 3rd file
+ END'
+
+file4_data=abcd
+file4_len=4
+
###
### series A
###
@@ -16,22 +26,19 @@ cat >input <<INPUT_END
blob
mark :2
data <<EOF
-file2
-second line of EOF
+$file2_data
EOF
blob
mark :3
data <<END
-EOF
-in 3rd file
- END
+$file3_data
END
blob
mark :4
-data 4
-abcd
+data $file4_len
+$file4_data
commit refs/heads/master
mark :5
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
@@ -73,24 +80,17 @@ test_expect_success \
'git-cat-file -p master^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
diff -u expect actual'
-cat >expect <<EOF
-file2
-second line of EOF
-EOF
+echo "$file2_data" >expect
test_expect_success \
'A: verify file2' \
'git-cat-file blob master:file2 >actual && diff -u expect actual'
-cat >expect <<END
-EOF
-in 3rd file
- END
-END
+echo "$file3_data" >expect
test_expect_success \
'A: verify file3' \
'git-cat-file blob master:file3 >actual && diff -u expect actual'
-printf abcd >expect
+printf "$file4_data" >expect
test_expect_success \
'A: verify file4' \
'git-cat-file blob master:file4 >actual && diff -u expect actual'