[PATCH 1/2] fast-import: add 'commit from 0{40}' failing test
- From
Dmitry Ivankov <divanorama@gmail.com>
- Date
- Sep 18, 2011, 21:20 UTC
- Message-ID
- <1316380846-15845-2-git-send-email-divanorama@gmail.com>
- In-Reply-To
- <1316380846-15845-1-git-send-email-divanorama@gmail.com>
Following shouldn't be allowed, while it is:
commit refs/heads/some committer ... data ... from `null_sha1`
It is treated as if 'from' was omitted. But it is allowed to just omit 'from' actually. And `null_sha1` being special in fast-import is an internal implementation detail.
Add a test as described.
Signed-off-by: Dmitry Ivankov <divanorama@gmail.com> --- t/t9300-fast-import.sh | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 1a6c066..8cc3f16 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -375,6 +375,18 @@ test_expect_success 'B: fail on invalid branch name "bad[branch]name"' ' rm -f .git/objects/pack_* .git/objects/index_* cat >input <<INPUT_END +commit refs/heads/zeromaster +committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE +data 0 + +from 0000000000000000000000000000000000000000 +INPUT_END +test_expect_failure 'B: fail on "from 0{40}"' ' + test_must_fail git fast-import <input +' +rm -f .git/objects/pack_* .git/objects/index_* + +cat >input <<INPUT_END commit TEMP_TAG committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT
-- 1.7.3.4