say session does not exist if meta does not exist

This commit is contained in:
Nikita Galaiko 2023-02-20 08:56:19 +01:00
parent f92a2370bd
commit ea9fa3dca4
No known key found for this signature in database
GPG Key ID: EBAB54E845BA519D

View File

@ -67,12 +67,11 @@ fn parse_reflog_line(line: &str) -> Result<Activity> {
impl Session {
pub fn current(repo: &git2::Repository, project: &projects::Project) -> Result<Option<Self>> {
let session_path = project.session_path();
if !session_path.exists() {
let meta_path = session_path.join("meta");
if !meta_path.exists() {
return Ok(None);
}
let meta_path = session_path.join("meta");
let start_path = meta_path.join("start");
let start_ts = std::fs::read_to_string(start_path.clone())?
.parse::<u64>()