Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Don't forward fetches with sha in want" #1333

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions josh-proxy/src/bin/josh-proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ fn fetch_needed(
head_ref: Option<&str>,
head_ref_resolved: Option<&str>,
) -> Result<bool, FetchError> {
if let Some(head_ref) = head_ref {
if head_ref != "HEAD" && !head_ref.starts_with("refs/") {
// If the request is for fetching a sha, don't fetch, as most upstreams
// don't support that. The rev should have been fetched previously by reference.
return Ok(false);
}
}

let fetch_timer_ok = {
if let Some(last) = service.fetch_timers.read()?.get(remote_url) {
let since = std::time::Instant::now().duration_since(*last);
Expand Down
8 changes: 2 additions & 6 deletions tests/proxy/clone_sha.t
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@

$ cd ${TESTTMP}

$ git ls-remote http://localhost:8002/real_repo.git | tr '\t' ' '
bb282e9cdc1b972fffd08fd21eead43bc0c83cb8 HEAD
36c6ab9d481503e14a88f783e87f3791aa8cef99 refs/heads/branch-1
bb282e9cdc1b972fffd08fd21eead43bc0c83cb8 refs/heads/master

Checks the following:

1) Two different formats for separating origin ref in the remote URL
Expand Down Expand Up @@ -135,6 +130,7 @@ Check (2) and (3) but with a branch ref
| | `-- upstream
| | `-- real_repo.git
| | |-- HEAD
| | |-- bb282e9cdc1b972fffd08fd21eead43bc0c83cb8
| | `-- refs
| | `-- heads
| | |-- branch-1
Expand All @@ -154,5 +150,5 @@ Check (2) and (3) but with a branch ref
|-- namespaces
`-- tags

35 directories, 22 files
35 directories, 23 files

Loading