diff --git a/inc/Workspace/StandaloneWorktreeProvider.php b/inc/Workspace/StandaloneWorktreeProvider.php index 32afeff6..728be020 100644 --- a/inc/Workspace/StandaloneWorktreeProvider.php +++ b/inc/Workspace/StandaloneWorktreeProvider.php @@ -554,7 +554,7 @@ private function default_base( string $primary_path ): string { private function remote_refs_digest( string $primary_path ): ?string { $refs = $this->run_git($primary_path, array( 'for-each-ref', '--format=%(refname) %(objectname)', 'refs/remotes/origin' )); - return $refs['success'] ? hash('sha256', $refs['stdout']) : null; + return $refs['success'] ? hash('sha256', rtrim($refs['stdout'], "\r\n")) : null; } /** diff --git a/tests/standalone-worktree-provider.php b/tests/standalone-worktree-provider.php index f23e2c68..807a3a70 100644 --- a/tests/standalone-worktree-provider.php +++ b/tests/standalone-worktree-provider.php @@ -145,7 +145,7 @@ function standalone_provider_remove( string $path ): void { $refs = standalone_provider_run(array( 'git', '-C', $primary, 'for-each-ref', '--format=%(refname) %(objectname)', 'refs/remotes/origin' )); \DataMachineCode\Workspace\WorktreeFreshnessEvidence::store($primary, array( 'version' => 2, - 'remote_refs_digest' => hash('sha256', $refs['stdout']), + 'remote_refs_digest' => hash('sha256', rtrim($refs['stdout'], "\r\n")), 'ref_heads' => array(), 'observed_at' => gmdate('c'), ));