Skip to main content

session_holders

Function session_holders 

Source
pub fn session_holders(repo: &str) -> Result<Vec<SessionHolder>>
Expand description

Every session recorded for one repository, live or not, in token order.

The library form of onevcs session holders, and the question a caller asks before it has a token: which sessions hold this repository’s workspaces, which of them still have an owner, and which are the remains of a run that stopped. SessionHolder::token is what the rest of this surface takes, so a holder is a session to act on rather than a line to read.

It takes no Providers because there is nothing here for an implementation to answer: the holders are the records under this host’s state root, which is where Git writes them and where the command reads them. A Vcs that keeps its sessions elsewhere therefore does not appear in this list — the same limit the command has, since the two are one path.

A record whose owner process has exited and whose run root no live process is working inside is forgotten as this answers rather than reported: nobody is left to be asked about it, and a list of those is what buries the one holder a caller had to act on. A session somebody is still working in is reported however long ago the command that opened it exited.