Skip to content

Commit e0de4e2

Browse files
authored
Fix git sync export showing no commit message for computed revisions (#1178)
* Fix git sync export showing no commit message for computed revisions * Add changeset
1 parent c2ee6ce commit e0de4e2

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

.changeset/khaki-trees-enjoy.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@gitbook/integration-github': patch
3+
'@gitbook/integration-gitlab': patch
4+
---
5+
6+
Fix git sync export showing no commit message for computed revisions

integrations/github/src/sync.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ export async function triggerExport(
141141

142142
logger.info(`Initiating an export from space ${spaceId} to GitHub`);
143143

144-
const { data: revision } = await api.spaces.getCurrentRevision(spaceId);
144+
// We only need the source revision here so mergedFrom is preserved for the export commit
145+
// message. Computed revision details are not needed here because the runner git sync
146+
// computes the revision anyway.
147+
const { data: revision } = await api.spaces.getCurrentRevision(spaceId, { computed: false });
145148

146149
const auth = await getRepositoryAuth(context, config, false);
147150
const repoTreeURL = getGitTreeURL(config);

integrations/gitlab/src/sync.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ export async function triggerExport(
134134

135135
logger.info(`Initiating an export from space ${spaceId} to GitLab`);
136136

137-
const { data: revision } = await api.spaces.getCurrentRevision(spaceId);
137+
// We only need the source revision here so mergedFrom is preserved for the export commit
138+
// message. Computed revision details are not needed here because the runner git sync
139+
// computes the revision anyway.
140+
const { data: revision } = await api.spaces.getCurrentRevision(spaceId, { computed: false });
138141

139142
const auth = await getRepositoryAuth(config);
140143
const repoTreeURL = getGitTreeURL(config);

0 commit comments

Comments
 (0)