refactor: GetDiffShortStat and fix panic caused by inconsistent "changed file number" (#39248)

This commit is contained in:
wxiaoguang
2026-09-06 05:20:42 +00:00
committed by GitHub
parent e5e7b2e76e
commit 3bd7ea4c9f
13 changed files with 143 additions and 146 deletions
+8
View File
@@ -330,3 +330,11 @@ func GetAffectedFiles(ctx context.Context, repo *Repository, branchName, oldComm
return affectedFiles, err
}
// GetReverseRawDiff dumps the reverse diff results of repository in given commit ID to io.Writer.
func GetReverseRawDiff(ctx context.Context, repo RepositoryFacade, commitID string, writer io.Writer) error {
return gitcmd.NewCommand("show", "--pretty=format:revert %H%n", "-R").
AddDynamicArguments(commitID).
WithStdoutCopy(writer).
WithRepo(repo).RunWithStderr(ctx)
}