Git fork

Merge branch 'hy/read-cache-lock-error-fix'

A failure to open the index file for writing due to conflicting
access did not state what went wrong, which has been corrected.

* hy/read-cache-lock-error-fix:
read-cache: report lock error when refreshing index

+8 -13
+2 -1
read-cache.c
··· 1456 1456 struct lock_file lock_file = LOCK_INIT; 1457 1457 int fd, ret = 0; 1458 1458 1459 - fd = repo_hold_locked_index(repo, &lock_file, 0); 1459 + fd = repo_hold_locked_index(repo, &lock_file, 1460 + gentle ? 0 : LOCK_REPORT_ON_ERROR); 1460 1461 if (!gentle && fd < 0) 1461 1462 return -1; 1462 1463 if (refresh_index(repo->index, refresh_flags, pathspec, seen, header_msg))
+6 -12
t/t3903-stash.sh
··· 1672 1672 echo change >A.file && 1673 1673 touch .git/index.lock && 1674 1674 1675 - cat >expect <<-EOF && 1676 - error: could not write index 1677 - EOF 1678 1675 test_must_fail git stash create 2>err && 1679 - test_cmp expect err 1676 + test_grep "error: could not write index" err && 1677 + test_grep "error: Unable to create '.*index.lock'" err 1680 1678 ) 1681 1679 ' 1682 1680 ··· 1689 1687 echo change >A.file && 1690 1688 touch .git/index.lock && 1691 1689 1692 - cat >expect <<-EOF && 1693 - error: could not write index 1694 - EOF 1695 1690 test_must_fail git stash push 2>err && 1696 - test_cmp expect err 1691 + test_grep "error: could not write index" err && 1692 + test_grep "error: Unable to create '.*index.lock'" err 1697 1693 ) 1698 1694 ' 1699 1695 ··· 1707 1703 git stash push && 1708 1704 touch .git/index.lock && 1709 1705 1710 - cat >expect <<-EOF && 1711 - error: could not write index 1712 - EOF 1713 1706 test_must_fail git stash apply 2>err && 1714 - test_cmp expect err 1707 + test_grep "error: could not write index" err && 1708 + test_grep "error: Unable to create '.*index.lock'" err 1715 1709 ) 1716 1710 ' 1717 1711