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:
Bruce Zu
2012-12-20 16:26:50 +08:00
committed by David Pursehouse
parent 3e5aba87e8
commit 56da320d53

View File

@@ -177,10 +177,7 @@ public class LocalDiskRepositoryManager implements GitRepositoryManager {
// It doesn't exist under any of the standard permutations
// of the repository name, so prefer the standard bare name.
//
String n = name.get();
if (!n.endsWith(Constants.DOT_GIT_EXT)) {
n = n + Constants.DOT_GIT_EXT;
}
String n = name.get() + Constants.DOT_GIT_EXT;
loc = FileKey.exact(new File(basePath, n), FS.DETECTED);
}