Fixes issues with merge commits

This commit is contained in:
Eric Amodio
2017-03-26 13:50:04 -04:00
parent 8b5eed4714
commit 3856cfd110
6 changed files with 38 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
'use strict';
import { Arrays } from '../system';
import { Arrays, Iterables } from '../system';
import { QuickPickItem, QuickPickOptions, Uri, window } from 'vscode';
import { Commands, Keyboard, KeyNoopCommand } from '../commands';
import { GitCommit, GitLogCommit, GitService, GitUri, IGitLog } from '../gitService';
@@ -118,6 +118,10 @@ export class CommitFileDetailsQuickPick {
if (!c || !c.previousSha) {
log = await git.getLogForFile(commit.repoPath, uri.fsPath, commit.sha, git.config.advanced.maxQuickHistory);
c = log && log.commits.get(commit.sha);
// Since we exclude merge commits in file log, just grab the first returned commit
if (!c && commit.isMerge) {
c = Iterables.first(log.commits.values());
}
if (c) {
// Copy over next info, since it is trustworthy at this point