@@ -162,14 +162,6 @@ func (c *AzureDevopsClient) FetchFileDiffs(ctx context.Context, repoName, repoOw
162162 continue
163163 }
164164
165- // Azure does not track number of lines added, changed, or deleted so we default to the zero-value for these fields
166- fileChange := GitPullRequestFileChanges {
167- Filename : path ,
168- Additions : 0 ,
169- Deletions : 0 ,
170- Changes : 0 ,
171- }
172-
173165 targetBranch := cleanBranchName (* pr .TargetRefName )
174166 sourceBranch := cleanBranchName (* pr .SourceRefName )
175167 getNewContentArgs := adogit.GetItemArgs {
@@ -189,13 +181,21 @@ func (c *AzureDevopsClient) FetchFileDiffs(ctx context.Context, repoName, repoOw
189181 continue
190182 }
191183
184+ // Azure does not track number of lines added, changed, or deleted so we default to the zero-value for these fields
185+ fileChange := GitPullRequestFileChanges {
186+ Filename : path ,
187+ Additions : 0 ,
188+ Deletions : 0 ,
189+ Changes : 0 ,
190+ FileContent : newContent ,
191+ }
192+
192193 switch * change .ChangeType {
193194 case adogit .VersionControlChangeTypeValues .Add :
194195 if newContentType == "base64Encoded" {
195196 fileChange .Patch = createPatch (path , path , "" , placeholderBinaryContent )
196197 } else {
197- patch := createPatch (path , path , "" , newContent )
198- fileChange .Patch = fmt .Sprintf ("Added file content: %s" , patch )
198+ fileChange .Patch = createPatch (path , path , "" , newContent )
199199 }
200200
201201 case adogit .VersionControlChangeTypeValues .Edit , adogit .VersionControlChangeTypeValues .Delete :
@@ -221,8 +221,7 @@ func (c *AzureDevopsClient) FetchFileDiffs(ctx context.Context, repoName, repoOw
221221 if oldContentType == "base64Encoded" {
222222 oldContent = placeholderBinaryContent
223223 }
224- patch := createPatch (path , path , oldContent , newContent )
225- fileChange .Patch = fmt .Sprintf ("New content of file: %s\n Diff of file: %s" , newContent , patch )
224+ fileChange .Patch = createPatch (path , path , oldContent , newContent )
226225 }
227226 default :
228227 log .Printf ("Unknown change type: %s" , * change .ChangeType )
0 commit comments