diff --git a/cmd/src/actions_exec_backend_runner.go b/cmd/src/actions_exec_backend_runner.go index e8329e0230..f271919fe0 100644 --- a/cmd/src/actions_exec_backend_runner.go +++ b/cmd/src/actions_exec_backend_runner.go @@ -239,7 +239,11 @@ func runAction(ctx context.Context, prefix, repoID, repoName, rev string, steps return nil, errors.Wrap(err, "git add failed") } - diffOut, err := runGitCmd("diff", "--cached") + // As of Sourcegraph 3.14 we only support unified diff format. + // That means we need to strip away the `a/` and `/b` prefixes with `--no-prefix`. + // See: https://github.com/sourcegraph/sourcegraph/blob/82d5e7e1562fef6be5c0b17f18631040fd330835/enterprise/internal/campaigns/service.go#L324-L329 + // + diffOut, err := runGitCmd("diff", "--cached", "--no-prefix") if err != nil { return nil, errors.Wrap(err, "git diff failed") }