Skip to content

Commit f956664

Browse files
committed
chore: align active probe cache formatting
1 parent f1eaca7 commit f956664

2 files changed

Lines changed: 23 additions & 8 deletions

File tree

inc/Workspace/Workspace.php

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,10 +1661,22 @@ public function worktree_active_no_signal_report( array $opts = array() ): array
16611661
'remote_tracking' => array(),
16621662
'commits_outside_default' => array(),
16631663
'stats' => array(
1664-
'default_ref' => array( 'hits' => 0, 'misses' => 0 ),
1665-
'github_slug' => array( 'hits' => 0, 'misses' => 0 ),
1666-
'remote_tracking' => array( 'hits' => 0, 'misses' => 0 ),
1667-
'commits_outside_default' => array( 'hits' => 0, 'misses' => 0 ),
1664+
'default_ref' => array(
1665+
'hits' => 0,
1666+
'misses' => 0,
1667+
),
1668+
'github_slug' => array(
1669+
'hits' => 0,
1670+
'misses' => 0,
1671+
),
1672+
'remote_tracking' => array(
1673+
'hits' => 0,
1674+
'misses' => 0,
1675+
),
1676+
'commits_outside_default' => array(
1677+
'hits' => 0,
1678+
'misses' => 0,
1679+
),
16681680
),
16691681
);
16701682
$rows = array();
@@ -2826,7 +2838,7 @@ private function cached_active_no_signal_remote_tracking_probe( string $primary_
28262838
}
28272839

28282840
$this->record_active_no_signal_probe_cache_stat($probe_cache, 'remote_tracking', false);
2829-
$result = $this->run_git($primary_path, sprintf('rev-parse --verify --quiet %s', escapeshellarg($remote_ref)), self::CLEANUP_GIT_PROBE_TIMEOUT);
2841+
$result = $this->run_git($primary_path, sprintf('rev-parse --verify --quiet %s', escapeshellarg($remote_ref)), self::CLEANUP_GIT_PROBE_TIMEOUT);
28302842
$probe_cache['remote_tracking'][ $key ] = $result;
28312843
return $result;
28322844
}
@@ -2867,7 +2879,7 @@ private function cached_active_no_signal_commits_outside_default_probe( string $
28672879
}
28682880

28692881
$this->record_active_no_signal_probe_cache_stat($probe_cache, 'commits_outside_default', false);
2870-
$result = $this->run_git(
2882+
$result = $this->run_git(
28712883
$primary_path,
28722884
sprintf('rev-list --count %s..%s', escapeshellarg($default_ref), escapeshellarg('refs/heads/' . $branch)),
28732885
self::CLEANUP_GIT_PROBE_TIMEOUT
@@ -2890,7 +2902,7 @@ private function cached_active_no_signal_github_slug_probe( string $primary_path
28902902
}
28912903

28922904
$this->record_active_no_signal_probe_cache_stat($probe_cache, 'github_slug', false);
2893-
$result = $this->resolve_github_slug($primary_path);
2905+
$result = $this->resolve_github_slug($primary_path);
28942906
$probe_cache['github_slug'][ $primary_path ] = $result;
28952907
return $result;
28962908
}

tests/smoke-worktree-metadata-reconcile.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,10 @@ function () use ( $tmp ) {
528528
$default_ref_probe_cache = array(
529529
'default_ref' => array(),
530530
'stats' => array(
531-
'default_ref' => array( 'hits' => 0, 'misses' => 0 ),
531+
'default_ref' => array(
532+
'hits' => 0,
533+
'misses' => 0,
534+
),
532535
),
533536
);
534537
$first_default_ref = $default_ref_cache_reflection->invokeArgs($ws, array( $primary, &$default_ref_probe_cache ));

0 commit comments

Comments
 (0)