filename=$(git ls-tree --name-only HEAD | head -n1) &&
git ls-tree --name-only HEAD >files &&
filename=$(head -n1 files) &&
git notes add -m "Note on a blob" HEAD:$filename &&
git notes show HEAD:$filename >actual &&
test_cmp expect actual &&
@ -745,10 +765,13 @@ test_expect_success 'create note from other note with "git notes add -C"' '
@@ -745,10 +765,13 @@ test_expect_success 'create note from other note with "git notes add -C"' '
Notes:
${indent}order test
EOF
git notes add -C $(git notes list HEAD^) &&
note=$(git notes list HEAD^) &&
git notes add -C $note &&
git log -1 >actual &&
test_cmp expect actual &&
test "$(git notes list HEAD)" = "$(git notes list HEAD^)"
git notes list HEAD^ >expect &&
git notes list HEAD >actual &&
test_cmp expect actual
'
test_expect_success 'create note from non-existing note with "git notes add -C" fails' '
@ -777,11 +800,12 @@ test_expect_success 'create note from blob with "git notes add -C" reuses blob i
@@ -777,11 +800,12 @@ test_expect_success 'create note from blob with "git notes add -C" reuses blob i
Notes:
${indent}This is a blob object
EOF
blob=$(echo "This is a blob object" | git hash-object -w --stdin) &&
git notes add -C $blob &&
echo "This is a blob object" | git hash-object -w --stdin >blob &&
git notes add -C $(cat blob) &&
git log -1 >actual &&
test_cmp expect actual &&
test "$(git notes list HEAD)" = "$blob"
git notes list HEAD >actual &&
test_cmp blob actual
'
test_expect_success 'create note from other note with "git notes add -c"' '
@ -797,7 +821,8 @@ test_expect_success 'create note from other note with "git notes add -c"' '
@@ -797,7 +821,8 @@ test_expect_success 'create note from other note with "git notes add -c"' '
Notes:
${indent}yet another note
EOF
MSG="yet another note" git notes add -c $(git notes list HEAD^^) &&
note=$(git notes list HEAD^^) &&
MSG="yet another note" git notes add -c $note &&
git log -1 >actual &&
test_cmp expect actual
'
@ -822,7 +847,8 @@ test_expect_success 'append to note from other note with "git notes append -C"'
@@ -822,7 +847,8 @@ test_expect_success 'append to note from other note with "git notes append -C"'
${indent}
${indent}yet another note
EOF
git notes append -C $(git notes list HEAD^) HEAD^ &&
note=$(git notes list HEAD^) &&
git notes append -C $note HEAD^ &&
git log -1 HEAD^ >actual &&
test_cmp expect actual
'
@ -839,7 +865,8 @@ test_expect_success 'create note from other note with "git notes append -c"' '
@@ -839,7 +865,8 @@ test_expect_success 'create note from other note with "git notes append -c"' '
@ -858,7 +885,8 @@ test_expect_success 'append to note from other note with "git notes append -c"'
@@ -858,7 +885,8 @@ test_expect_success 'append to note from other note with "git notes append -c"'
${indent}
${indent}yet another note
EOF
MSG="yet another note" git notes append -c $(git notes list HEAD) &&
note=$(git notes list HEAD) &&
MSG="yet another note" git notes append -c $note &&
@ -1212,26 +1298,36 @@ test_expect_success 'git notes copy diagnoses too many or too few parameters' '
@@ -1212,26 +1298,36 @@ test_expect_success 'git notes copy diagnoses too many or too few parameters' '
test_expect_success 'git notes get-ref expands refs/heads/master to refs/notes/refs/heads/master' '
test_unconfig core.notesRef &&
sane_unset GIT_NOTES_REF &&
test "$(git notes --ref=refs/heads/master get-ref)" = "refs/notes/refs/heads/master"
@ -250,6 +251,7 @@ test_expect_success 'choking "git rm" should not let it die with cruft' '
@@ -250,6 +251,7 @@ test_expect_success 'choking "git rm" should not let it die with cruft' '
echo "100644 $hash 0 some-file-$i"
i=$(( $i + 1 ))
done | git update-index --index-info &&
# git command is intentionally placed upstream of pipe to induce SIGPIPE
git rm -n "some-file-*" | : &&
test_path_is_missing .git/index.lock
'
@ -303,7 +305,8 @@ EOF
@@ -303,7 +305,8 @@ EOF
test_expect_success 'rm removes empty submodules from work tree' '
@ -864,11 +876,14 @@ test_expect_success 'diff that introduces a line with only tabs' '
@@ -864,11 +876,14 @@ test_expect_success 'diff that introduces a line with only tabs' '
test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '
@ -72,7 +67,8 @@ test_expect_success 'get an error for missing tree object' '
@@ -72,7 +67,8 @@ test_expect_success 'get an error for missing tree object' '
echo foo >r5/foo &&
git -C r5 add foo &&
git -C r5 commit -m "foo" &&
del=$(git -C r5 rev-parse HEAD^{tree} | sed "s|..|&/|") &&
@ -167,15 +133,15 @@ test_expect_success 'packed unreachable obs in alternate ODB are not loosened' '
@@ -167,15 +133,15 @@ test_expect_success 'packed unreachable obs in alternate ODB are not loosened' '
--unpack-unreachable </dev/null pack &&
rm -f .git/objects/pack/* &&
mv pack-* .git/objects/pack/ &&
test 0 = $(git verify-pack -v -- .git/objects/pack/*.idx |
# The pack-objects call on the next line is equivalent to
@ -184,10 +150,10 @@ test_expect_success 'local packed unreachable obs that exist in alternate ODB ar
@@ -184,10 +150,10 @@ test_expect_success 'local packed unreachable obs that exist in alternate ODB ar
--unpack-unreachable </dev/null pack &&
rm -f .git/objects/pack/* &&
mv pack-* .git/objects/pack/ &&
test 0 = $(git verify-pack -v -- .git/objects/pack/*.idx |
test_expect_success 'objects made unreachable by grafts only are kept' '
@ -196,7 +162,7 @@ test_expect_success 'objects made unreachable by grafts only are kept' '
@@ -196,7 +162,7 @@ test_expect_success 'objects made unreachable by grafts only are kept' '