Add #getName() and #getNameKey() to ProjectState

This commit adds #getName() and #getNameKey() to ProjectState and
migrates callers to spare calling #getProject() in many places.

Change-Id: I124d370b47723ff3fc7d5bc51a697890a16ab01c
This commit is contained in:
Patrick Hiesel
2017-09-07 16:07:34 +02:00
parent d46fb98646
commit 55326bd493
29 changed files with 61 additions and 63 deletions

View File

@@ -69,8 +69,7 @@ public abstract class AbstractGitCommand extends BaseCommand {
@Override
public Project.NameKey getProjectName() {
Project project = projectControl.getProjectState().getProject();
return project.getNameKey();
return projectControl.getProjectState().getNameKey();
}
});
} finally {

View File

@@ -226,6 +226,6 @@ final class AdminSetParent extends SshCommand {
if (ps == null) {
return Collections.emptySet();
}
return ps.parents().transform(s -> s.getProject().getNameKey()).toSet();
return ps.parents().transform(s -> s.getNameKey()).toSet();
}
}