Skip to content

Commit

Permalink
Fix new git based diff generation file paths (#147)
Browse files Browse the repository at this point in the history
* Fix new git based diff generation file paths

* Update cmd/src/actions_exec_backend_runner.go

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
  • Loading branch information
eseliger and mrnugget authored Mar 2, 2020
1 parent c3b659c commit 44008e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/src/actions_exec_backend_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 44008e1

Please sign in to comment.