upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/git/handlers.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-26 15:42:09 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-26 15:42:09 +0000
commit9d86cf15f0275ffeee4519bd054e3b61dc8992ac (patch)
tree65b5d5ffb2a11b5ecd05d01e63fb5a4a0f8b6e06 /src/git/handlers.rs
parenta2ecfc5a63311570f0f90c7ee40117e289639cb8 (diff)
chore: apply cargo fmt and fix clippy warnings
Fix pre-existing clippy lints: - &PathBuf -> &Path in audit_cleanup.rs - too_many_arguments on process_newly_available_git_data, process_purgatory_announcements, and HttpService::new - clone_on_copy for PublicKey (Copy type) in purgatory cleanup loop
Diffstat (limited to 'src/git/handlers.rs')
-rw-r--r--src/git/handlers.rs66
1 files changed, 24 insertions, 42 deletions
diff --git a/src/git/handlers.rs b/src/git/handlers.rs
index 5ff3a7f..b615251 100644
--- a/src/git/handlers.rs
+++ b/src/git/handlers.rs
@@ -154,13 +154,10 @@ pub async fn handle_upload_pack(
154 154
155 // Write request to git's stdin 155 // Write request to git's stdin
156 if let Some(mut stdin) = git.take_stdin() { 156 if let Some(mut stdin) = git.take_stdin() {
157 stdin 157 stdin.write_all(&request_body).await.map_err(|e| {
158 .write_all(&request_body) 158 error!("Failed to write to git upload-pack stdin: {}", e);
159 .await 159 GitError::IoError(e)
160 .map_err(|e| { 160 })?;
161 error!("Failed to write to git upload-pack stdin: {}", e);
162 GitError::IoError(e)
163 })?;
164 // Close stdin to signal end of input 161 // Close stdin to signal end of input
165 drop(stdin); 162 drop(stdin);
166 } 163 }
@@ -171,24 +168,18 @@ pub async fn handle_upload_pack(
171 168
172 if let Some(stdout) = git.take_stdout() { 169 if let Some(stdout) = git.take_stdout() {
173 let mut stdout = stdout; 170 let mut stdout = stdout;
174 stdout 171 stdout.read_to_end(&mut output).await.map_err(|e| {
175 .read_to_end(&mut output) 172 error!("Failed to read git upload-pack stdout: {}", e);
176 .await 173 GitError::IoError(e)
177 .map_err(|e| { 174 })?;
178 error!("Failed to read git upload-pack stdout: {}", e);
179 GitError::IoError(e)
180 })?;
181 } 175 }
182 176
183 if let Some(stderr) = git.take_stderr() { 177 if let Some(stderr) = git.take_stderr() {
184 let mut stderr = stderr; 178 let mut stderr = stderr;
185 stderr 179 stderr.read_to_end(&mut stderr_output).await.map_err(|e| {
186 .read_to_end(&mut stderr_output) 180 error!("Failed to read git upload-pack stderr: {}", e);
187 .await 181 GitError::IoError(e)
188 .map_err(|e| { 182 })?;
189 error!("Failed to read git upload-pack stderr: {}", e);
190 GitError::IoError(e)
191 })?;
192 } 183 }
193 184
194 // Wait for process 185 // Wait for process
@@ -317,13 +308,10 @@ pub async fn handle_receive_pack(
317 308
318 // Write request to git's stdin 309 // Write request to git's stdin
319 if let Some(mut stdin) = git.take_stdin() { 310 if let Some(mut stdin) = git.take_stdin() {
320 stdin 311 stdin.write_all(&request_body).await.map_err(|e| {
321 .write_all(&request_body) 312 error!("Failed to write to git receive-pack stdin: {}", e);
322 .await 313 GitError::IoError(e)
323 .map_err(|e| { 314 })?;
324 error!("Failed to write to git receive-pack stdin: {}", e);
325 GitError::IoError(e)
326 })?;
327 drop(stdin); 315 drop(stdin);
328 } 316 }
329 317
@@ -333,24 +321,18 @@ pub async fn handle_receive_pack(
333 321
334 if let Some(stdout) = git.take_stdout() { 322 if let Some(stdout) = git.take_stdout() {
335 let mut stdout = stdout; 323 let mut stdout = stdout;
336 stdout 324 stdout.read_to_end(&mut output).await.map_err(|e| {
337 .read_to_end(&mut output) 325 error!("Failed to read git receive-pack stdout: {}", e);
338 .await 326 GitError::IoError(e)
339 .map_err(|e| { 327 })?;
340 error!("Failed to read git receive-pack stdout: {}", e);
341 GitError::IoError(e)
342 })?;
343 } 328 }
344 329
345 if let Some(stderr) = git.take_stderr() { 330 if let Some(stderr) = git.take_stderr() {
346 let mut stderr = stderr; 331 let mut stderr = stderr;
347 stderr 332 stderr.read_to_end(&mut stderr_output).await.map_err(|e| {
348 .read_to_end(&mut stderr_output) 333 error!("Failed to read git receive-pack stderr: {}", e);
349 .await 334 GitError::IoError(e)
350 .map_err(|e| { 335 })?;
351 error!("Failed to read git receive-pack stderr: {}", e);
352 GitError::IoError(e)
353 })?;
354 } 336 }
355 337
356 // Wait for process 338 // Wait for process