scripts: "export VAR=VALUE" construct is not portable
[gitweb.git] / t / t1006-cat-file.sh
index 8a1bc5c53281eb6f44c15d68dd0ae737bc0125f3..1687098355b710850a04769512320930d9b8b27b 100755 (executable)
@@ -85,6 +85,28 @@ $content"
                git cat-file --batch-check="%(objecttype) %(rest)" >actual &&
        test_cmp expect actual
     '
+
+    test -z "$content" ||
+    test_expect_success "--batch without type ($type)" '
+       {
+               echo "$size" &&
+               maybe_remove_timestamp "$content" $no_ts
+       } >expect &&
+       echo $sha1 | git cat-file --batch="%(objectsize)" >actual.full &&
+       maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
+       test_cmp expect actual
+    '
+
+    test -z "$content" ||
+    test_expect_success "--batch without size ($type)" '
+       {
+               echo "$type" &&
+               maybe_remove_timestamp "$content" $no_ts
+       } >expect &&
+       echo $sha1 | git cat-file --batch="%(objecttype)" >actual.full &&
+       maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
+       test_cmp expect actual
+    '
 }
 
 hello_content="Hello World"