| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,13 +16,17 @@ def TestOneInput(data): | |||
| 16 | 16 | ||
| 17 | 17 | with tempfile.TemporaryDirectory() as temp_dir: | |
| 18 | 18 | repo = git.Repo.init(path=temp_dir) | |
| 19 | - blob = git.Blob( | ||
| 20 | - repo, | ||
| 21 | - **{ | ||
| 22 | - "binsha": git.Blob.NULL_BIN_SHA, | ||
| 23 | - "path": fdp.ConsumeUnicodeNoSurrogates(fdp.remaining_bytes()), | ||
| 24 | - }, | ||
| 25 | - ) | ||
| 19 | + binsha = fdp.ConsumeBytes(20) | ||
| 20 | + mode = fdp.ConsumeInt(fdp.ConsumeIntInRange(0, fdp.remaining_bytes())) | ||
| 21 | + path = fdp.ConsumeUnicodeNoSurrogates(fdp.remaining_bytes()) | ||
| 22 | + | ||
| 23 | + try: | ||
| 24 | + blob = git.Blob(repo, binsha, mode, path) | ||
| 25 | + except AssertionError as e: | ||
| 26 | + if "Require 20 byte binary sha, got" in str(e): | ||
| 27 | + return -1 | ||
| 28 | + else: | ||
| 29 | + raise e | ||
| 26 | 30 | ||
| 27 | 31 | _ = blob.mime_type | |
| 28 | 32 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments