abhinav / abhinav/git-spice

'gs repo sync' left repo in broken state with concurrent write

Abierto
#659 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Go
Estrellas
762
Forks
72
Merge medio
18 h 24 min
PR fusionados (30 d)
28

Descripción

A user reported the following:

```
$ gs repo sync
INF master: pulled 19 new commit(s)
INF feat1: #330613 was merged
FTL gs: delete merged branches: rebase: exit status 1
stderr:
error: update_ref failed for ref 'HEAD': cannot lock ref 'HEAD': Unable to create '[..]/.git/HEAD.lock': File exists.

Another git process [..]
error: could not detach HEAD
```

It looks like the rebase operation performed as part of deleting merged branches ran afoul of another process messing with the Git branch.

After the error, the user was left with a working tree at the state of the master branch, but HEAD pointing to the branch we failed to delete.

I don't think we can guard against HEAD.lock/index.lock conflicts, but perhaps there should be more recovery here.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.