Fix branch refresh.

This commit is contained in:
Greyson Parrelli committed 2026-08-27 12:10:32 -04:00
1 parent 11ebe07e4f
commit 2e3af19d00
3 files changed
+44 -6

No files matched your search

+10 -1
View File
@@ -783,7 +783,16 @@ fn handleRevision(
else => "git could not produce that diff — check the base ref",
},
);
return writeJson(a, request, .ok, .{ .revision = rev });
// The branch rides along with the digest so the page can notice that the
// work tree moved to another branch — which the digest alone cannot always
// say. `digest` hashes HEAD's *sha*, so branching off the commit you are
// already on (`git switch -c`) leaves it identical while the name in the
// review's header is now wrong. One `rev-parse` next to the `git diff` this
// endpoint already runs is not a cost worth avoiding.
return writeJson(a, request, .ok, .{
.revision = rev,
.branch = git.currentBranch(repo, a, self.io),
});
}
fn handleFile(