mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
When RecordCurrentDirectory fails, only log the error
If we return the error here, we don't switch repos, but the chdir happened already, so this would be an inconsistent state (a lot of lazygit's code assumes that the current directory is always the worktree root). Only log the error; failing to record the current directory is not the end of the world. Also, it is very unlikely to happen; RecordCurrentDirectory only writes to a small file, and if this fails, then either there is filesystem corruption of the disk is full, and in both cases the user likely has much bigger problems.
This commit is contained in:
parent
009c8975be
commit
d86a49ba3f
|
|
@ -171,7 +171,7 @@ func (self *ReposHelper) DispatchSwitchTo(path string, errMsg string, contextKey
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := self.recordDirectoryHelper.RecordCurrentDirectory(); err != nil {
|
if err := self.recordDirectoryHelper.RecordCurrentDirectory(); err != nil {
|
||||||
return err
|
self.c.Log.Errorf("error recording current directory: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
self.c.Mutexes().RefreshingFilesMutex.Lock()
|
self.c.Mutexes().RefreshingFilesMutex.Lock()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue