Skip to content

Commit 259f4ee

Browse files
committed
Prevent repeated workspace git status loops
1 parent d59d203 commit 259f4ee

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

inc/Tools/WorkspaceTools.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ public function getDeleteDefinition(): array
11431143
*/
11441144
public function getGitStatusDefinition(): array
11451145
{
1146-
return $this->simpleGitDefinition('handleGitStatus', 'Get git status information for a workspace handle.', array(), array( 'name' ), array( 'duplicate_policy' => 'repeatable' ));
1146+
return $this->simpleGitDefinition('handleGitStatus', 'Get git status information for a workspace handle. Use once to inspect cleanliness, then move to a concrete edit, commit, or completion outcome.', array());
11471147
}
11481148

11491149
/**

tests/smoke-workspace-policy-tools.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ static function ( array $tools ) use ( $tool_id, $definition_callback, $contexts
9797
$show_definition = $workspace_tools->getShowDefinition();
9898
$assert('workspace_show does not allow duplicate repeat calls', 'repeatable' !== ( $show_definition['runtime']['duplicate_policy'] ?? null ));
9999

100+
$git_status_definition = $workspace_tools->getGitStatusDefinition();
101+
$assert('workspace_git_status does not allow duplicate repeat calls', 'repeatable' !== ( $git_status_definition['runtime']['duplicate_policy'] ?? null ));
102+
100103
$ls_definition = $workspace_tools->getLsDefinition();
101104
$assert('workspace_ls still allows intentional repeat calls', 'repeatable' === ( $ls_definition['runtime']['duplicate_policy'] ?? null ));
102105

0 commit comments

Comments
 (0)