Skip to content

Commit c6d084b

Browse files
committed
git: Fix libgit2 not noticing index changes
Signed-off-by: Russell Currey <ruscur@russell.cc>
1 parent 9002c15 commit c6d084b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/git.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ fn do_work(id: u64, workdir: PathBuf) -> Result<()> {
333333
// We (hopefully) now have exclusive access to the worktree.
334334
let mut worktree_path = workdir.clone();
335335
worktree_path.push(format!("snowpatch{}", worker_id));
336-
let repo = Repository::open(&worktree_path)?;
336+
let mut repo = Repository::open(&worktree_path)?;
337337

338338
clean_and_reset(&repo, "master")?;
339339

@@ -357,7 +357,9 @@ fn do_work(id: u64, workdir: PathBuf) -> Result<()> {
357357
// There's a disappointingly large chance that a series that won't
358358
// apply with git2 will actually apply just fine with the binary.
359359
// So let's do that instead.
360+
drop(repo);
360361
git_binary_apply_mbox(&worktree_path, &mbox)?;
362+
repo = Repository::open(&worktree_path)?;
361363
}
362364
}
363365

0 commit comments

Comments
 (0)