Skip to content

Commit 90bea89

Browse files
Align targeted worktree lookup assignments (#896)
* feat: add targeted worktree safety lookup * style: align worktree lookup assignments --------- Co-authored-by: homeboy-ci[bot] <266378653+homeboy-ci[bot]@users.noreply.github.com>
1 parent ccb70c6 commit 90bea89

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

inc/Cli/Commands/WorkspaceCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4539,11 +4539,11 @@ private function renderWorktreeResult( string $operation, array $result, array $
45394539
}
45404540
$items = array_map(
45414541
function ( $wt ) {
4542-
$skipped = (array) ( $wt['fields_skipped'] ?? array() );
4543-
$dirty = $wt['dirty'] ?? null;
4542+
$skipped = (array) ( $wt['fields_skipped'] ?? array() );
4543+
$dirty = $wt['dirty'] ?? null;
45444544
$unpushed = $wt['unpushed'] ?? null;
4545-
$size = $wt['size_bytes'] ?? null;
4546-
$item = array(
4545+
$size = $wt['size_bytes'] ?? null;
4546+
$item = array(
45474547
'handle' => $wt['handle'] ?? '',
45484548
'repo' => $wt['repo'] ?? '',
45494549
'kind' => ! empty($wt['is_primary']) ? 'primary' : 'worktree',

inc/Workspace/WorkspaceWorktreeLifecycle.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -850,11 +850,11 @@ public function worktree_list( ?string $repo = null, ?string $state = null, arra
850850
}
851851

852852
if ( $include_status ) {
853-
$dirty_result = $this->run_git($wt['path'], 'status --porcelain');
854-
$dirty_files = is_wp_error($dirty_result)
853+
$dirty_result = $this->run_git($wt['path'], 'status --porcelain');
854+
$dirty_files = is_wp_error($dirty_result)
855855
? 0
856856
: count(array_filter(array_map('trim', explode("\n", $dirty_result['output'] ?? ''))));
857-
$unpushed_commits = $this->count_unpushed_commits($wt['path']);
857+
$unpushed_commits = $this->count_unpushed_commits($wt['path']);
858858
if ( is_wp_error($unpushed_commits) ) {
859859
return $unpushed_commits;
860860
}

0 commit comments

Comments
 (0)