mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2024-04-21 12:32:08 +00:00
fix (git): logic that's caching different repo locally
This commit is contained in:
@@ -16,7 +16,7 @@ func (a *AppCache) Get(key interface{}) interface{} {
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
value, found := a.Cache.Get(fmt.Sprint(hash))
|
||||
value, found := a.Cache.Get(fmt.Sprintf("%d", hash))
|
||||
if found == false {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -172,5 +172,8 @@ func GenerateID(ctx *App) string {
|
||||
if params["token"] != "" {
|
||||
p += "token =>" + params["token"]
|
||||
}
|
||||
if p == "salt => " + SECRET_KEY {
|
||||
return ""
|
||||
}
|
||||
return Hash(p)
|
||||
}
|
||||
|
||||
@@ -96,8 +96,8 @@ func (git Git) Init(params map[string]string, app *App) (IBackend, error) {
|
||||
return nil, NewError("Your password doesn't fit in a cookie :/", 500)
|
||||
}
|
||||
|
||||
hash := GenerateID(app)
|
||||
p.basePath = GetAbsolutePath(GitCachePath + "repo_" + fmt.Sprint(hash) + "/")
|
||||
hash := GenerateID(app)
|
||||
p.basePath = GetAbsolutePath(GitCachePath + "repo_" + hash + "/")
|
||||
|
||||
repo, err := g.git.open(p, p.basePath)
|
||||
g.git.repo = repo
|
||||
|
||||
Reference in New Issue
Block a user