summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-01-10 23:24:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-10 23:24:26 (GMT)
commit87359ffcc8a583c537aabefac0a9e444690c21fa (patch)
treea6690cb274d98d8e54e8a19f4b5c1a2afa35e7c4 /t
parent02d0457eb4b9bf656965c5dbb613b8bfaef3316f (diff)
parent405d7f4af64ece9a49c48b1b0c43b161b2dd94d5 (diff)
downloadgit-87359ffcc8a583c537aabefac0a9e444690c21fa.zip
git-87359ffcc8a583c537aabefac0a9e444690c21fa.tar.gz
git-87359ffcc8a583c537aabefac0a9e444690c21fa.tar.bz2
Merge branch 'mh/fast-import-notes-fix-new'
"git fast-import" sometimes mishandled while rebalancing notes tree, which has been fixed. * mh/fast-import-notes-fix-new: fast-import: properly fanout notes when tree is imported
Diffstat (limited to 't')
-rwxr-xr-xt/t9301-fast-import-notes.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/t/t9301-fast-import-notes.sh b/t/t9301-fast-import-notes.sh
index 83acf68..dadc70b 100755
--- a/t/t9301-fast-import-notes.sh
+++ b/t/t9301-fast-import-notes.sh
@@ -483,6 +483,48 @@ test_expect_success 'verify that lots of notes trigger a fanout scheme' '
'
+# Create another notes tree from the one above
+SP=" "
+cat >>input <<INPUT_END
+commit refs/heads/other_commits
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+commit #$(($num_commit + 1))
+COMMIT
+
+from refs/heads/many_commits
+M 644 inline file
+data <<EOF
+file contents in commit #$(($num_commit + 1))
+EOF
+
+commit refs/notes/other_notes
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+committing one more note on a tree imported from a previous notes tree
+COMMIT
+
+M 040000 $(git log --no-walk --format=%T refs/notes/many_notes)$SP
+N inline :$(($num_commit + 1))
+data <<EOF
+note for commit #$(($num_commit + 1))
+EOF
+INPUT_END
+
+test_expect_success 'verify that importing a notes tree respects the fanout scheme' '
+ git fast-import <input &&
+
+ # None of the entries in the top-level notes tree should be a full SHA1
+ git ls-tree --name-only refs/notes/other_notes |
+ while read path
+ do
+ if test $(expr length "$path") -ge 40
+ then
+ return 1
+ fi
+ done
+'
+
cat >>expect_non-note1 << EOF
This is not a note, but rather a regular file residing in a notes tree
EOF