git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug] pull --prune could not delete references due to lock file already exists error
@ 2025-06-25 12:32 ryenus
  2025-06-25 14:18 ` Re " K Jayatheerth
  0 siblings, 1 reply; 14+ messages in thread
From: ryenus @ 2025-06-25 12:32 UTC (permalink / raw)
  To: Git mailing list

today I tried to prune the remote refs in a local repo, but `git pull --prune`
failed with an error saying it could not delete references. I retried several
times and it failed consistently, without a single ref pruned.

I found this interesting comment while looking into the code here:
https://github.com/git/git/blob/bd99d6e8db5e2c56dd24395e9711ee7ee564bf4f/refs.c#L2863-L2895

> /*
>  * Since we don't check the references' old_oids, the
>  * individual updates can't fail, so we can pack all of the
>  * updates into a single transaction.
>  */

The problem is the assume is wrong, coz things could fail, one such case
is to have two refs like below:

1. origin/TOM/b1
2. origin/TOM/b2
3. origin/tom/b2

Notice there's `TOM` vs `tom` in the path. Another factor is that my local file
system is case insensitive. As a result the 3rd ref would fail and cause the
transaction to be always rolled back.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-07-02 15:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-25 12:32 [bug] pull --prune could not delete references due to lock file already exists error ryenus
2025-06-25 14:18 ` Re " K Jayatheerth
2025-06-27 18:59   ` brian m. carlson
2025-06-30  7:26     ` JAYATHEERTH K
2025-06-30 13:46   ` Karthik Nayak
2025-06-30 14:20     ` brian m. carlson
2025-06-30 21:10       ` Junio C Hamano
2025-07-01 10:31         ` Patrick Steinhardt
2025-07-01 16:14           ` Junio C Hamano
2025-07-02  8:50             ` Patrick Steinhardt
2025-07-01  8:20       ` Karthik Nayak
2025-07-02  4:50       ` Chris Torek
2025-07-02 15:37         ` Junio C Hamano
2025-07-01  0:52     ` JAYATHEERTH K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).