Fix: cache data inconsistent with disk
According to [1], Gerrit drops project names' trailing '.git' suffix before adding them to the cache as the KEY, however for the corner case of creating a project like 'p.git.git', Gerrit will create 'p.git', NOT 'p.git.git', on disk and cache it as 'p.git'. [1]. LocalDiskRepositoryManager.getProjectName() Change-Id: I578dc56cf87aedfd09bd8d1ddddc08d43ad2a9e0
This commit is contained in:
committed by
David Pursehouse
parent
3e5aba87e8
commit
56da320d53
@@ -177,10 +177,7 @@ public class LocalDiskRepositoryManager implements GitRepositoryManager {
|
|||||||
// It doesn't exist under any of the standard permutations
|
// It doesn't exist under any of the standard permutations
|
||||||
// of the repository name, so prefer the standard bare name.
|
// of the repository name, so prefer the standard bare name.
|
||||||
//
|
//
|
||||||
String n = name.get();
|
String n = name.get() + Constants.DOT_GIT_EXT;
|
||||||
if (!n.endsWith(Constants.DOT_GIT_EXT)) {
|
|
||||||
n = n + Constants.DOT_GIT_EXT;
|
|
||||||
}
|
|
||||||
loc = FileKey.exact(new File(basePath, n), FS.DETECTED);
|
loc = FileKey.exact(new File(basePath, n), FS.DETECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user