Skip to content

Commit 93a6735

Browse files
committed
Update git2 update_tips with UPDATE_FETCHHEAD
1 parent bb723e6 commit 93a6735

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/git.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1+
use std::cell::RefCell;
12
use std::io::Write;
2-
use std::{
3-
cell::RefCell,
4-
path::{Path, PathBuf},
5-
};
3+
use std::path::{Path, PathBuf};
64

7-
use git2::AutotagOption;
8-
use git2::{
9-
build::{CheckoutBuilder, RepoBuilder},
10-
FetchOptions, Progress, RemoteCallbacks, Repository,
11-
};
5+
use git2::build::{CheckoutBuilder, RepoBuilder};
6+
use git2::{AutotagOption, FetchOptions, Progress, RemoteCallbacks, RemoteUpdateFlags, Repository};
127

138
struct State {
149
progress: Option<Progress<'static>>,
@@ -186,7 +181,12 @@ pub fn pull(repo: &Path) -> Result<(), git2::Error> {
186181
// commits. This may be needed even if there was no packfile to download,
187182
// which can happen e.g. when the branches have been changed but all the
188183
// needed objects are available locally.
189-
remote.update_tips(None, true, AutotagOption::Unspecified, None)?;
184+
remote.update_tips(
185+
None,
186+
RemoteUpdateFlags::UPDATE_FETCHHEAD,
187+
AutotagOption::Unspecified,
188+
None,
189+
)?;
190190

191191
let fetch_head = repo.find_reference("FETCH_HEAD")?;
192192
let fetch_commit = repo.reference_to_annotated_commit(&fetch_head)?;

0 commit comments

Comments
 (0)