Class WorkingSetResolver
java.lang.Object
network.ike.workspace.WorkingSetResolver
Resolves the
WorkingSet a working-tree workspace operation acts
on, from a starting directory (IKE-Network/ike-issues#609, under #601).
Searches upward from the start directory for a workspace.yaml.
When one is found, the working set is that workspace — its declared
subprojects plus the workspace root. When none is found, the working set
is the single repository at the start directory: a working set of one.
This is the single home for the "am I in a workspace, or a lone repo?"
decision that working-tree goals otherwise each make for themselves — the
scattered isWorkspaceMode() + bare-mode branches the migration in
ike-issues#611 retires.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe manifest file name searched for when walking up from a directory. -
Method Summary
Modifier and TypeMethodDescriptionstatic WorkingSetResolve the working set from a starting directory.static WorkingSetsingleRepo(Path dir) Build a single-repository working set rooted atdir, without searching for a manifest — a working set of one.
-
Field Details
-
MANIFEST_FILE
The manifest file name searched for when walking up from a directory.- See Also:
-
-
Method Details
-
resolve
Resolve the working set from a starting directory.- Parameters:
startDir- the directory to resolve from (typically the CWD)- Returns:
- a workspace working set when a
workspace.yamlis found at or abovestartDir; otherwise the single-repository working set rooted atstartDir
-
singleRepo
Build a single-repository working set rooted atdir, without searching for a manifest — a working set of one.- Parameters:
dir- the repository directory- Returns:
- the single-repository working set
-