| test_description='Intent to add' |
| test_expect_success 'intent to add' ' |
| test_expect_success 'check result of "add -N"' ' |
| git ls-files -s file >actual && |
| empty=$(git hash-object --stdin </dev/null) && |
| echo "100644 $empty 0 file" >expect && |
| test_expect_success 'intent to add is just an ordinary empty blob' ' |
| git ls-files -s file >actual && |
| git ls-files -s elif | sed -e "s/elif/file/" >expect && |
| test_expect_success 'intent to add does not clobber existing paths' ' |
| empty=$(git hash-object --stdin </dev/null) && |
| git ls-files -s >actual && |
| test_expect_success 'i-t-a entry is simply ignored' ' |
| git commit -a -m initial && |
| test $(git ls-tree HEAD -- nitfol | wc -l) = 0 && |
| test $(git diff --name-only HEAD -- nitfol | wc -l) = 1 |
| test_expect_success 'can commit with an unrelated i-t-a entry in index' ' |
| git commit -m partial rezrov |
| test_expect_success 'can "commit -a" with an i-t-a entry' ' |