Skip to content

Commit 012f8dc

Browse files
Revert "Don't forward fetches with sha in want (#1313)" (#1333)
This reverts commit a22ab2a.
1 parent b28d490 commit 012f8dc

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

josh-proxy/src/bin/josh-proxy.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,6 @@ fn fetch_needed(
111111
head_ref: Option<&str>,
112112
head_ref_resolved: Option<&str>,
113113
) -> Result<bool, FetchError> {
114-
if let Some(head_ref) = head_ref {
115-
if head_ref != "HEAD" && !head_ref.starts_with("refs/") {
116-
// If the request is for fetching a sha, don't fetch, as most upstreams
117-
// don't support that. The rev should have been fetched previously by reference.
118-
return Ok(false);
119-
}
120-
}
121-
122114
let fetch_timer_ok = {
123115
if let Some(last) = service.fetch_timers.read()?.get(remote_url) {
124116
let since = std::time::Instant::now().duration_since(*last);

tests/proxy/clone_sha.t

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@
5454

5555
$ cd ${TESTTMP}
5656

57-
$ git ls-remote http://localhost:8002/real_repo.git | tr '\t' ' '
58-
bb282e9cdc1b972fffd08fd21eead43bc0c83cb8 HEAD
59-
36c6ab9d481503e14a88f783e87f3791aa8cef99 refs/heads/branch-1
60-
bb282e9cdc1b972fffd08fd21eead43bc0c83cb8 refs/heads/master
61-
6257
Checks the following:
6358

6459
1) Two different formats for separating origin ref in the remote URL
@@ -135,6 +130,7 @@ Check (2) and (3) but with a branch ref
135130
| | `-- upstream
136131
| | `-- real_repo.git
137132
| | |-- HEAD
133+
| | |-- bb282e9cdc1b972fffd08fd21eead43bc0c83cb8
138134
| | `-- refs
139135
| | `-- heads
140136
| | |-- branch-1
@@ -154,5 +150,5 @@ Check (2) and (3) but with a branch ref
154150
|-- namespaces
155151
`-- tags
156152

157-
35 directories, 22 files
153+
35 directories, 23 files
158154

0 commit comments

Comments
 (0)