Repositories

grarr

(mirrored on github)

Modified Cargo.lock

@@ -333,7 +333,7 @@ dependencies = [
[[package]]
name = "git-ship"
version = "0.1.0"
source = "git+https://github.com/Nemo157/git-ship-rs#8145d658d4b0e054b605f53da154ac8cd4929656"
source = "git+https://github.com/Nemo157/git-ship-rs#dd5422a234c45bcce5ae962b5e5a4a217bae0f4e"
dependencies = [
"git2 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",

Modified src/handler/git_smart_http/refs.rs

@@ -12,7 +12,7 @@ impl Handler for Refs {
fn handle(&self, req: &mut Request) -> IronResult<Response> {
let context = itry!(req.extensions.get::<RepositoryContext>().ok_or(Error::from("missing extension")), status::InternalServerError);
let response = itry!(refs::prepare(&context.repository, &req.url.clone().into()), status::InternalServerError);
println!("response: {:?}", response);
println!("refs response: {:?}", response);
let status_code = status::Unregistered(response.status_code());
let mime: Mime = response.mime_type().parse().unwrap();
Ok(Response::with((status_code, mime, Box::new(W(response)) as Box<WriteBody>)))

Modified src/handler/git_smart_http/upload_pack.rs

@@ -3,6 +3,7 @@ use handler::base::*;
use std::io;
use iron::headers::{ CacheControl, CacheDirective, Vary, Pragma, Expires, HttpDate, ContentEncoding, Encoding };
use iron::mime::Mime;
use iron::modifiers::Header;
use iron::response::WriteBody;
use unicase::UniCase;
@@ -48,8 +49,10 @@ impl Handler for UploadPack {
let context = itry!(req.extensions.remove::<RepositoryContext>().ok_or(Error::from("missing extension")), status::InternalServerError);
let mut body = itry!(body_thing(req), (status::BadRequest, no_cache));
let response = itry!(upload_pack::prepare(context.repository, &mut *body), (status::BadRequest, no_cache));
println!("upload_pack response: {:?}", response);
let status_code = status::Unregistered(response.status_code());
Ok(Response::with((status_code, no_cache, Box::new(W(response)) as Box<WriteBody>)))
let mime: Mime = response.mime_type().parse().unwrap();
Ok(Response::with((status_code, mime, no_cache, Box::new(W(response)) as Box<WriteBody>)))
}
}