summaryrefslogtreecommitdiff
path: root/t/t1007-hash-object.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-05-11 14:23:59 -0700
committerJunio C Hamano <gitster@pobox.com>2015-05-11 14:23:59 -0700
commit051086b947ee7a6fdd5697889a225098f723761d (patch)
tree0920d85e5e97dad89618cf87307a3f4d0bf5abbe /t/t1007-hash-object.sh
parentb9f5d3874f3406c820049b26fd7b10f7cae7138f (diff)
parent1427a7ff70bce0c1040831d5d674c83ebcda6d7d (diff)
downloadgit-051086b947ee7a6fdd5697889a225098f723761d.tar.gz
Merge branch 'jc/hash-object'
"hash-object --literally" introduced in v2.2 was not prepared to take a really long object type name. * jc/hash-object: write_sha1_file(): do not use a separate sha1[] array t1007: add hash-object --literally tests hash-object --literally: fix buffer overrun with extra-long object type git-hash-object.txt: document --literally option
Diffstat (limited to 't/t1007-hash-object.sh')
-rwxr-xr-xt/t1007-hash-object.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh
index ebb3a69c8c..7d2baa15bb 100755
--- a/t/t1007-hash-object.sh
+++ b/t/t1007-hash-object.sh
@@ -209,4 +209,15 @@ test_expect_success 'hash-object complains about truncated type name' '
test_must_fail git hash-object -t bl --stdin </dev/null
'
+test_expect_success '--literally' '
+ t=1234567890 &&
+ echo example | git hash-object -t $t --literally --stdin
+'
+
+test_expect_success '--literally with extra-long type' '
+ t=12345678901234567890123456789012345678901234567890 &&
+ t="$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t$t" &&
+ echo example | git hash-object -t $t --literally --stdin
+'
+
test_done