Skip to content

Commit 383c342

Browse files
sunshinecogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0c3db67 commit 383c342

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

t/t1007-hash-object.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,15 @@ test_expect_success 'corrupt tag' '
201201
test_must_fail git hash-object -t tag --stdin </dev/null
202202
'
203203

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+
204215
test_done

0 commit comments

Comments
 (0)