File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export function activate(context: vscode.ExtensionContext) {
4949 }
5050
5151 //获取当前的 git仓库实例 Get git repo instance
52- const repo = gitExtension ? .getAPI ( 1 ) . repositories [ 0 ] ;
52+ let repo : any = gitExtension . getAPI ( 1 ) . repositories [ 0 ] ;
5353 //输入提交详情 Input message detail
5454 const inputMessageDetail = ( _key : string | number ) => {
5555 const _detailType = CommitDetailType . find ( ( item ) => item . key === _key ) ;
@@ -116,7 +116,13 @@ export function activate(context: vscode.ExtensionContext) {
116116 } ) ;
117117 } ;
118118 //点击图标触发快捷选项 Click the icon to trigger shortcut options
119- let disposable = vscode . commands . registerCommand ( 'extension.showGitCommit' , ( ) => {
119+ let disposable = vscode . commands . registerCommand ( 'extension.showGitCommit' , ( uri ?) => {
120+ if ( uri ) {
121+ //如果有多个repo 寻找当前的 进行填充 If there are multiple repos looking for the current to populate
122+ repo = gitExtension . getAPI ( 1 ) . repositories . find ( ( repo ) => {
123+ return repo . rootUri . path === uri . _rootUri . path ;
124+ } ) ;
125+ }
120126 startMessageInput ( ) ;
121127 } ) ;
122128 context . subscriptions . push ( disposable ) ;
You can’t perform that action at this time.
0 commit comments