mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-30 20:41:42 -08:00
parent
283388da6a
commit
b869b3ccd0
|
@ -223,9 +223,10 @@ func (segment *Segment) restoreCache() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
data, OK := segment.env.Session().Get(segment.cacheKey())
|
||||
cacheKey := segment.cacheKey()
|
||||
data, OK := segment.env.Session().Get(cacheKey)
|
||||
if !OK {
|
||||
log.Debug("no cache found for segment: ", segment.Name())
|
||||
log.Debugf("no cache found for segment: %s, key: %s", segment.Name(), cacheKey)
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
@ -217,7 +217,9 @@ func (g *Git) CacheKey() (string, bool) {
|
|||
return "", false
|
||||
}
|
||||
|
||||
return dir.Path, true
|
||||
ref := g.FileContents(dir.Path, "HEAD")
|
||||
ref = strings.Replace(ref, "ref: refs/heads/", "", 1)
|
||||
return fmt.Sprintf("%s@%s", dir.Path, ref), true
|
||||
}
|
||||
|
||||
func (g *Git) Commit() *Commit {
|
||||
|
|
Loading…
Reference in a new issue