Skip to content

Commit 16fd764

Browse files
authored
Merge pull request #109 from lzutao/reserved-remote
Anonymously fetch from upstream rust repo
2 parents fb41a96 + d08b429 commit 16fd764

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/git.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ fn get_repo() -> Result<Repository, Error> {
3838
let repo = Repository::open(repo)?;
3939
{
4040
eprintln!("refreshing repository");
41-
let mut remote = repo
42-
.find_remote("origin")
43-
.or_else(|_| repo.remote_anonymous("origin"))?;
41+
let mut remote = repo.remote_anonymous(RUST_SRC_URL)?;
4442
remote.fetch(&["master"], None, None)?;
4543
}
4644
Ok(repo)

src/repo_access.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ impl RustRepositoryAccessor for AccessViaLocalGit {
3737
self::git::get_commit(commit_ref)
3838
}
3939
fn commits(&self, start_sha: &str, end_sha: &str) -> Result<Vec<Commit>, Error> {
40+
let end_sha = if end_sha == "origin/master" {
41+
"FETCH_HEAD"
42+
} else {
43+
end_sha
44+
};
4045
eprintln!(
4146
"fetching (via local git) commits from {} to {}",
4247
start_sha, end_sha

0 commit comments

Comments
 (0)