mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
Git - do not use commit^.. to get the list of commits (#221287)
This commit is contained in:
@@ -148,8 +148,16 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
|
||||
const historyItems: SourceControlHistoryItem[] = [];
|
||||
|
||||
try {
|
||||
// Get the commits
|
||||
const commits = await this.repository.log({ range: `${refsMergeBase}^..`, refNames, shortStats: true });
|
||||
// Get the common ancestor commit, and commits
|
||||
const [mergeBaseCommit, commits] = await Promise.all([
|
||||
this.repository.getCommit(refsMergeBase),
|
||||
this.repository.log({ range: `${refsMergeBase}..`, refNames, shortStats: true })
|
||||
]);
|
||||
|
||||
// Add common ancestor commit
|
||||
if (commits.length !== 0) {
|
||||
commits.push(mergeBaseCommit);
|
||||
}
|
||||
|
||||
await ensureEmojis();
|
||||
|
||||
@@ -171,7 +179,7 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
|
||||
};
|
||||
}));
|
||||
} catch (err) {
|
||||
this.logger.error(`[GitHistoryProvider][provideHistoryItems2] Failed to get history items '${refsMergeBase}^..': ${err}`);
|
||||
this.logger.error(`[GitHistoryProvider][provideHistoryItems2] Failed to get history items '${refsMergeBase}..': ${err}`);
|
||||
}
|
||||
|
||||
return historyItems;
|
||||
|
||||
Reference in New Issue
Block a user