@@ -4,7 +4,7 @@ import { Command, ExtensionContext, TreeItem, TreeItemCollapsibleState } from 'v
44import { Commands , DiffWithPreviousCommandArgs } from '../commands' ;
55import { CommitFileNode } from './commitFileNode' ;
66import { ExplorerNode , ResourceType } from './explorerNode' ;
7- import { CommitFormatter , getGitStatusIcon , GitLogCommit , GitService , GitUri } from '../gitService' ;
7+ import { CommitFormatter , getGitStatusIcon , GitLogCommit , GitService , GitUri , ICommitFormatOptions } from '../gitService' ;
88import * as path from 'path' ;
99
1010export class CommitNode extends ExplorerNode {
@@ -28,7 +28,11 @@ export class CommitNode extends ExplorerNode {
2828 }
2929
3030 getTreeItem ( ) : TreeItem {
31- const item = new TreeItem ( CommitFormatter . fromTemplate ( this . template , this . commit , this . git . config . defaultDateFormat ) ) ;
31+ const item = new TreeItem ( CommitFormatter . fromTemplate ( this . template , this . commit , {
32+ truncateMessageAtNewLine : true ,
33+ dataFormat : this . git . config . defaultDateFormat
34+ } as ICommitFormatOptions ) ) ;
35+
3236 if ( this . commit . type === 'file' ) {
3337 item . collapsibleState = TreeItemCollapsibleState . None ;
3438 item . command = this . getCommand ( ) ;
@@ -55,17 +59,6 @@ export class CommitNode extends ExplorerNode {
5559 }
5660
5761 getCommand ( ) : Command | undefined {
58- let allowMissingPrevious = false ;
59- let prefix = undefined ;
60- const status = this . commit . fileStatuses [ 0 ] ;
61- if ( status . status === 'A' ) {
62- allowMissingPrevious = true ;
63- prefix = 'added in ' ;
64- }
65- else if ( status . status === 'D' ) {
66- prefix = 'deleted in ' ;
67- }
68-
6962 return {
7063 title : 'Compare File with Previous Revision' ,
7164 command : Commands . DiffWithPrevious ,
@@ -77,9 +70,7 @@ export class CommitNode extends ExplorerNode {
7770 showOptions : {
7871 preserveFocus : true ,
7972 preview : true
80- } ,
81- allowMissingPrevious : allowMissingPrevious ,
82- rightTitlePrefix : prefix
73+ }
8374 } as DiffWithPreviousCommandArgs
8475 ]
8576 } ;
0 commit comments