Fix git log SSH: split SHA and timestamp into separate calls to avoid shell quoting

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-14 09:16:05 +00:00
parent e66164cdb7
commit 20a8d50084

View file

@ -144,17 +144,13 @@ async function refreshStatus(repo) {
return null return null
} }
const [currentRaw, latest] = await Promise.all([ const [[currentSha, currentTimestamp], latest] = await Promise.all([
sshGet(target.host, ['git', '-C', target.path, 'log', '-1', '--format=%H %cI', 'HEAD']), Promise.all([
sshGet(target.host, ['git', '-C', target.path, 'log', '-1', '--format=%H', 'HEAD']),
sshGet(target.host, ['git', '-C', target.path, 'log', '-1', '--format=%cI', 'HEAD']),
]),
getForgejoCommit(repo), getForgejoCommit(repo),
]) ])
let currentSha = null, currentTimestamp = null
if (currentRaw && currentRaw.includes(' ')) {
const sp = currentRaw.indexOf(' ')
currentSha = currentRaw.slice(0, sp)
currentTimestamp = currentRaw.slice(sp + 1)
}
const deployed = !!currentSha const deployed = !!currentSha
const entry = { const entry = {
repo, repo,