Skip to content

Commit f349204

Browse files
committed
Use $GIT_INDEX_FILE instead of --index-output to avoid lockfile problem
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.
1 parent c39e0b3 commit f349204

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

models/pull.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,8 @@ func (pr *PullRequest) testPatch() (err error) {
437437

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

0 commit comments

Comments
 (0)