From c6487ef55653dd188f95f279369c748cad66095f Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Thu, 15 Sep 2011 14:48:56 +0200 Subject: [PATCH] set-parent-project: evict child projects from project cache When a project gets reparented it's not evicted from the project cache and the cached project instance still points to the old parent project. Due to this e.g. the 'ls-projects --tree' command delivers incorrect results right after a project was reparented with the 'set-project-parent' command. Change-Id: If64f46688a2a03ffed6bb67ca8161bb16e9bb59a Signed-off-by: Edwin Kempin --- .../java/com/google/gerrit/sshd/commands/AdminSetParent.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/AdminSetParent.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/AdminSetParent.java index 95bc563919..3492645c18 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/AdminSetParent.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/AdminSetParent.java @@ -132,6 +132,8 @@ final class AdminSetParent extends BaseCommand { } catch (ConfigInvalidException e) { throw new Failure(1, "Cannot update project " + name, e); } + + projectCache.evict(pc.getProject()); } if (err.length() > 0) {