Skip to content

Commit 44008e1

Browse files
eseligermrnugget
andauthored
Fix new git based diff generation file paths (#147)
* Fix new git based diff generation file paths * Update cmd/src/actions_exec_backend_runner.go Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
1 parent c3b659c commit 44008e1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cmd/src/actions_exec_backend_runner.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,11 @@ func runAction(ctx context.Context, prefix, repoID, repoName, rev string, steps
239239
return nil, errors.Wrap(err, "git add failed")
240240
}
241241

242-
diffOut, err := runGitCmd("diff", "--cached")
242+
// As of Sourcegraph 3.14 we only support unified diff format.
243+
// That means we need to strip away the `a/` and `/b` prefixes with `--no-prefix`.
244+
// See: https://github.com/sourcegraph/sourcegraph/blob/82d5e7e1562fef6be5c0b17f18631040fd330835/enterprise/internal/campaigns/service.go#L324-L329
245+
//
246+
diffOut, err := runGitCmd("diff", "--cached", "--no-prefix")
243247
if err != nil {
244248
return nil, errors.Wrap(err, "git diff failed")
245249
}

0 commit comments

Comments
 (0)