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/t3303-notes-subtrees.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 / t3303-notes-subtrees.sh` 198 lines ยท 5263 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='Test commit notes organized in subtrees' 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)) || return 1 34 done > expect && 35 test_cmp expect output 36 } 37 38 test_expect_success "setup: create $number_of_commits commits" ' 39 40 ( 41 nr=0 && 42 while [ $nr -lt $number_of_commits ]; do 43 nr=$(($nr+1)) && 44 test_tick && 45 cat < $GIT_COMMITTER_DATE 48 data < $GIT_COMMITTER_DATE 64 data <out && 82 while read sha1; do 83 note_path=$(echo "$sha1" | sed "$1") 84 cat <gfi && 95 git fast-import --quiet output && 175 i=$number_of_commits && 176 while [ $i -gt 0 ]; do 177 echo " commit #$i" && 178 echo " first note for commit #$i" && 179 echo " " && 180 echo " second note for commit #$i" && 181 i=$(($i-1)) || return 1 182 done > expect && 183 test_cmp expect output 184 } 185 186 test_expect_success 'test notes in no fanout concatenated with 2/38-fanout' 'test_concatenated_notes "s|^..|&/|" ""' 187 test_expect_success 'verify notes in no fanout concatenated with 2/38-fanout' 'verify_concatenated_notes' 188 189 test_expect_success 'test notes in no fanout concatenated with 2/2/36-fanout' 'test_concatenated_notes "s|^\(..\)\(..\)|\1/\2/|" ""' 190 test_expect_success 'verify notes in no fanout concatenated with 2/2/36-fanout' 'verify_concatenated_notes' 191 192 test_expect_success 'test notes in 2/38-fanout concatenated with 2/2/36-fanout' 'test_concatenated_notes "s|^\(..\)\(..\)|\1/\2/|" "s|^..|&/|"' 193 test_expect_success 'verify notes in 2/38-fanout concatenated with 2/2/36-fanout' 'verify_concatenated_notes' 194 195 test_expect_success 'test notes in 2/2/36-fanout concatenated with 2/2/2/34-fanout' 'test_concatenated_notes "s|^\(..\)\(..\)\(..\)|\1/\2/\3/|" "s|^\(..\)\(..\)|\1/\2/|"' 196 test_expect_success 'verify notes in 2/2/36-fanout concatenated with 2/2/2/34-fanout' 'verify_concatenated_notes' 197 198 test_done