@@ -17,6 +17,7 @@ const getGitStatus = async (repoPath) => {
17
17
let gitLatestCommit = "" ;
18
18
let gitTrackedFiles = "" ;
19
19
let gitTotalTrackedFiles = 0 ;
20
+ let gitAllBranchList = [ ] ;
20
21
21
22
const gitRemoteReference = [
22
23
"github" ,
@@ -97,6 +98,31 @@ const getGitStatus = async (repoPath) => {
97
98
gitRemoteHost = "No Remote Host Set" ;
98
99
}
99
100
101
+ //Module to get all branch list
102
+ gitAllBranchList =
103
+ isGitLogAvailable &&
104
+ ( await execPromised ( `git branch --all` , {
105
+ cwd : repoPath ,
106
+ windowsHide : true ,
107
+ } )
108
+ . then ( ( res ) => {
109
+ const { stdout, stderr } = res ;
110
+ if ( stdout && ! stderr ) {
111
+ let localBranchList = stdout . trim ( ) . split ( "\n" ) ;
112
+ localBranchList = localBranchList . map ( ( branch ) => {
113
+ return branch ;
114
+ } ) ;
115
+ return localBranchList ;
116
+ } else {
117
+ console . log ( stderr ) ;
118
+ return [ ] ;
119
+ }
120
+ } )
121
+ . catch ( ( err ) => {
122
+ console . log ( err ) ;
123
+ return [ ] ;
124
+ } ) ) ;
125
+
100
126
// Module to get all available branches
101
127
gitBranchList =
102
128
isGitLogAvailable &&
@@ -163,7 +189,7 @@ const getGitStatus = async (repoPath) => {
163
189
//Module to get latest git commit
164
190
165
191
isGitLogAvailable &&
166
- ( await execPromised ( `git log -1 --oneline` , {
192
+ ( await execPromised ( `git log -1 --oneline --pretty=format:"%s" ` , {
167
193
cwd : repoPath ,
168
194
windowsHide : true ,
169
195
} ) . then ( ( res ) => {
@@ -282,6 +308,7 @@ const getGitStatus = async (repoPath) => {
282
308
gitTrackedFiles,
283
309
gitFileBasedCommit,
284
310
gitTotalTrackedFiles,
311
+ gitAllBranchList,
285
312
} ;
286
313
287
314
console . log ( gitRepoDetails ) ;
0 commit comments