@@ -176,15 +176,16 @@ func (repo *Repository) GetDiffNumChangedFiles(base, head string, directComparis
176176
177177// GetDiffShortStat counts number of changed files, number of additions and deletions
178178func (repo * Repository ) GetDiffShortStat (base , head string ) (numFiles , totalAdditions , totalDeletions int , err error ) {
179- numFiles , totalAdditions , totalDeletions , err = GetDiffWithShortStat (repo .Ctx , repo .Path , nil , base + "..." + head )
179+ numFiles , totalAdditions , totalDeletions , err = GetDiffShortStatByCmdArgs (repo .Ctx , repo .Path , nil , base + "..." + head )
180180 if err != nil && strings .Contains (err .Error (), "no merge base" ) {
181- return GetDiffWithShortStat (repo .Ctx , repo .Path , nil , base , head )
181+ return GetDiffShortStatByCmdArgs (repo .Ctx , repo .Path , nil , base , head )
182182 }
183183 return numFiles , totalAdditions , totalDeletions , err
184184}
185185
186- // GetDiffWithShortStat counts number of changed files, number of additions and deletions
187- func GetDiffWithShortStat (ctx context.Context , repoPath string , trustedArgs TrustedCmdArgs , dynamicArgs ... string ) (numFiles , totalAdditions , totalDeletions int , err error ) {
186+ // GetDiffShortStatByCmdArgs counts number of changed files, number of additions and deletions
187+ // TODO: there are already 2 other different "GetDiffShortStat" functions in code base, they do similar things, need to refactor in the future
188+ func GetDiffShortStatByCmdArgs (ctx context.Context , repoPath string , trustedArgs TrustedCmdArgs , dynamicArgs ... string ) (numFiles , totalAdditions , totalDeletions int , err error ) {
188189 // Now if we call:
189190 // $ git diff --shortstat 1ebb35b98889ff77299f24d82da426b434b0cca0...788b8b1440462d477f45b0088875
190191 // we get:
0 commit comments