Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t3304-notes-mixed.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t3304-notes-mixed.sh` 209 lines ยท 4335 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='Test notes trees that also contain non-notes' 4 5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main 6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME 7 8 . ./test-lib.sh 9 10 number_of_commits=100 11 12 start_note_commit () { 13 test_tick && 14 cat < $GIT_COMMITTER_DATE 17 data < output && 29 i=$number_of_commits && 30 while [ $i -gt 0 ]; do 31 echo " commit #$i" && 32 echo " note for commit #$i" && 33 i=$(($i-1)); 34 done > expect && 35 test_cmp expect output 36 } 37 38 test_expect_success "setup: create a couple of commits" ' 39 40 test_tick && 41 cat <input && 42 commit refs/heads/main 43 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE 44 data <>input && 57 commit refs/heads/main 58 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE 59 data <input && 78 commit refs/notes/commits 79 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE 80 data <>input && 97 commit refs/notes/commits 98 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE 99 data <>input && 116 commit refs/notes/commits 117 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE 118 data <expect < actual && 163 test_cmp expect actual 164 ' 165 166 cat >expect_nn1 <expect_nn2 <expect_nn3 <expect_nn4 < actual_nn1 && 182 test_cmp expect_nn1 actual_nn1 && 183 git cat-file -p refs/notes/commits:deadbeef > actual_nn2 && 184 test_cmp expect_nn2 actual_nn2 && 185 git cat-file -p refs/notes/commits:de/adbeef > actual_nn3 && 186 test_cmp expect_nn3 actual_nn3 && 187 git cat-file -p refs/notes/commits:dead/beef > actual_nn4 && 188 test_cmp expect_nn4 actual_nn4 189 ' 190 191 test_expect_success "git-notes preserves non-notes" ' 192 193 test_tick && 194 git notes add -f -m "foo bar" 195 ' 196 197 test_expect_success "verify contents of non-notes after git-notes" ' 198 199 git cat-file -p refs/notes/commits:foobar/non-note.txt > actual_nn1 && 200 test_cmp expect_nn1 actual_nn1 && 201 git cat-file -p refs/notes/commits:deadbeef > actual_nn2 && 202 test_cmp expect_nn2 actual_nn2 && 203 git cat-file -p refs/notes/commits:de/adbeef > actual_nn3 && 204 test_cmp expect_nn3 actual_nn3 && 205 git cat-file -p refs/notes/commits:dead/beef > actual_nn4 && 206 test_cmp expect_nn4 actual_nn4 207 ' 208 209 test_done