fix: initial list of history in workspace mode (#1356)
The initial list didn't correctly show all history while in workspace mode, while it worked totally as expected while searching. Fix this.
This commit is contained in:
parent
bb438d8d59
commit
57a8db13c2
1 changed files with 7 additions and 1 deletions
|
@ -268,12 +268,18 @@ impl Database for Sqlite {
|
|||
query.and_where_is_null("deleted_at");
|
||||
}
|
||||
|
||||
let git_root = if let Some(git_root) = context.git_root.clone() {
|
||||
git_root.to_str().unwrap_or("/").to_string()
|
||||
} else {
|
||||
context.cwd.clone()
|
||||
};
|
||||
|
||||
match filter {
|
||||
FilterMode::Global => &mut query,
|
||||
FilterMode::Host => query.and_where_eq("hostname", quote(&context.hostname)),
|
||||
FilterMode::Session => query.and_where_eq("session", quote(&context.session)),
|
||||
FilterMode::Directory => query.and_where_eq("cwd", quote(&context.cwd)),
|
||||
FilterMode::Workspace => query.and_where_like_any("cwd", context.cwd.clone()),
|
||||
FilterMode::Workspace => query.and_where_like_left("cwd", git_root),
|
||||
};
|
||||
|
||||
if unique {
|
||||
|
|
Loading…
Reference in a new issue