t1007: add hash-object --literally tests
git-hash-object learned a --literally option in 5ba9a93 (hash-object: add --literally option, 2014-09-11). Check that --literally allows object creation with a bogus type, with two type strings whose length is reasonably short and very long. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eric Sunshine committed
May 4, 2015 at 03:25 UTC
383c3427afa3201eb05e931825c5c2f20616b58b
1 file changed
+11
t/t1007-hash-object.sh
+11
@@ -201,4 +201,15 @@ test_expect_success 'corrupt tag' '
201
test_must_fail git hash-object -t tag --stdin </dev/null
202
'
203
204
+test_expect_success '--literally' '
205
+ t=1234567890 &&
206
+ echo example | git hash-object -t $t --literally --stdin
207
+'
208
+
209
+test_expect_success '--literally with extra-long type' '
210
+ t=12345678901234567890123456789012345678901234567890 &&
211
+ 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" &&
212
+ echo example | git hash-object -t $t --literally --stdin
213
+'
214
+
215
test_done