diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-13 19:03:19 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-13 19:03:19 -0700 |
commit | c13975e7fd19a6939de264233eed20f93c6d1f46 (patch) | |
tree | 08e1cd1cb6b34922eee84ea129fe05229512ad13 /t | |
parent | 0fd8cb3fec7abb36505a150fe5cfa9b1d8b85496 (diff) | |
parent | 0bc69881a611c582f3b89a475882161d83c56494 (diff) | |
download | git-c13975e7fd19a6939de264233eed20f93c6d1f46.tar.gz git-c13975e7fd19a6939de264233eed20f93c6d1f46.tar.xz |
Merge branch 'di/fast-import-empty-tag-note-fix'
* di/fast-import-empty-tag-note-fix:
fast-import: don't allow to note on empty branch
fast-import: don't allow to tag empty branch
Diffstat (limited to 't')
-rwxr-xr-x | t/t9300-fast-import.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 1a6c06631..bd32b91d8 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -820,6 +820,18 @@ test_expect_success \ 'test 1 = `git rev-list J | wc -l` && test 0 = `git ls-tree J | wc -l`' +cat >input <<INPUT_END +reset refs/heads/J2 + +tag wrong_tag +from refs/heads/J2 +data <<EOF +Tag branch that was reset. +EOF +INPUT_END +test_expect_success \ + 'J: tag must fail on empty branch' \ + 'test_must_fail git fast-import <input' ### ### series K ### @@ -1975,6 +1987,23 @@ test_expect_success \ 'Q: verify second note for second commit' \ 'git cat-file blob refs/notes/foobar:$commit2 >actual && test_cmp expect actual' +cat >input <<EOF +reset refs/heads/Q0 + +commit refs/heads/note-Q0 +committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE +data <<COMMIT +Note for an empty branch. +COMMIT + +N inline refs/heads/Q0 +data <<NOTE +some note +NOTE +EOF +test_expect_success \ + 'Q: deny note on empty branch' \ + 'test_must_fail git fast-import <input' ### ### series R (feature and option) ### |