]> git.ipfire.org Git - thirdparty/git.git/commit
read-cache: report lock error when refreshing index
authorHan Young <hanyang.tony@bytedance.com>
Thu, 3 Jul 2025 07:45:02 +0000 (15:45 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Jul 2025 13:49:07 +0000 (06:49 -0700)
commit9455397a5cfcef186fab3321b3fbe29fd3ef78c7
treeb9798ccd08c31cfaf52e1cc42ae53c27e55d2667
parent16bd9f20a403117f2e0d9bcda6c6e621d3763e77
read-cache: report lock error when refreshing index

In the repo_refresh_and_write_index of read-cache.c, we return -1 to
indicate that writing the index to disk failed.
However, callers do not use this information. Commands such as stash print
  "could not write index"
and then exit, which does not help to discover the exact problem.

We can let repo_hold_locked_index print the error message if the locking
failed.

Signed-off-by: Han Young <hanyang.tony@bytedance.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c
t/t3903-stash.sh