Skip to content

Commit

Permalink
Use $GIT_INDEX_FILE instead of --index-output to avoid lockfile problem
Browse files Browse the repository at this point in the history
The lockfile gets renamed to the final destination after the operation
finishes. But it must be located in the same filesystem, which prevents
us from using /tmp.
  • Loading branch information
typeless committed Dec 29, 2016
1 parent c39e0b3 commit f349204
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ func (pr *PullRequest) testPatch() (err error) {

var stderr string
_, stderr, err = process.ExecDirEnv(-1, "", fmt.Sprintf("testPatch (git read-tree): %d", pr.BaseRepo.ID),
[]string{"GIT_DIR=" + pr.BaseRepo.RepoPath()},
"git", "read-tree", "--index-output", indexTmpPath, pr.BaseBranch)
[]string{"GIT_DIR=" + pr.BaseRepo.RepoPath(), "GIT_INDEX_FILE=" + indexTmpPath},
"git", "read-tree", pr.BaseBranch)
if err != nil {
return fmt.Errorf("git read-tree --index-output=%s %s: %v - %s", indexTmpPath, pr.BaseBranch, err, stderr)
}
Expand Down

0 comments on commit f349204

Please sign in to comment.