mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 15:07:20 +00:00
Improve LFS tests + fix lfs url refs + keep path upper/lowercase in db. (#3092)
* Add failing test * Fix urls * Improve url in tests * improve testing * Remove debug code * Add deps * LFS corner-case : Search on lower but store with case * Temporary comment of blocking action * fix hooks * Use temporary repo for git client test * Use userPassword in place of hard-coded password
This commit is contained in:
committed by
Lunny Xiao
parent
aecfc56156
commit
ef78309b65
@ -36,7 +36,7 @@ func (l *LFSLock) AfterLoad() {
|
||||
}
|
||||
|
||||
func cleanPath(p string) string {
|
||||
return strings.ToLower(path.Clean(p))
|
||||
return path.Clean(p)
|
||||
}
|
||||
|
||||
// APIFormat convert a Release to lfs.LFSLock
|
||||
@ -73,8 +73,8 @@ func CreateLFSLock(lock *LFSLock) (*LFSLock, error) {
|
||||
// GetLFSLock returns release by given path.
|
||||
func GetLFSLock(repoID int64, path string) (*LFSLock, error) {
|
||||
path = cleanPath(path)
|
||||
rel := &LFSLock{RepoID: repoID, Path: path}
|
||||
has, err := x.Get(rel)
|
||||
rel := &LFSLock{RepoID: repoID}
|
||||
has, err := x.Where("lower(path) = ?", strings.ToLower(path)).Get(rel)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user