diff --git a/src/git.rs b/src/git.rs index bbb1263..b4842ac 100644 --- a/src/git.rs +++ b/src/git.rs @@ -26,9 +26,11 @@ use tracing::instrument; use crate::syntax_highlight::ComrakSyntectAdapter; +type ReadmeCacheKey = (PathBuf, Option>); + pub struct Git { commits: Cache>, - readme_cache: Cache)>>, + readme_cache: Cache)>>, syntax_set: SyntaxSet, } @@ -220,7 +222,7 @@ impl OpenRepository { let git = self.git.clone(); git.readme_cache - .try_get_with(self.cache_key.clone(), async move { + .try_get_with((self.cache_key.clone(), self.branch.clone()), async move { tokio::task::spawn_blocking(move || { let repo = self.repo.lock();