History

change!: consistently use `object_hash` instead of `hash_kind` (#279)

Sebastian Thiel committed 4 years ago

Commit de4fa641 parent 81bd4533 files · +5 −5Browse files

Unified · Split

3 files
  1. gitoxide-core/src/pack/explode.rs +3 −3
  2. gitoxide-core/src/pack/index.rs +1 −1
  3. gitoxide-core/src/pack/receive.rs +1 −1
gitoxide-core/src/pack/explode.rs+3−3
@@ -130,10 +130,10 @@ impl git_repository::odb::Write for OutputWriter { · 129 unmodified lines
130130 }
131131
132132 impl OutputWriter {
133− fn new(path: Option<impl AsRef<Path>>, compress: bool, hash_kind: git_repository::hash::Kind) -> Self {
133+ fn new(path: Option<impl AsRef<Path>>, compress: bool, object_hash: git_repository::hash::Kind) -> Self {
134134 match path {
135− Some(path) => OutputWriter::Loose(loose::Store::at(path.as_ref(), hash_kind)),
136− None => OutputWriter::Sink(odb::sink(hash_kind).compress(compress)),
135+ Some(path) => OutputWriter::Loose(loose::Store::at(path.as_ref(), object_hash)),
136+ None => OutputWriter::Sink(odb::sink(object_hash).compress(compress)),
137137 }
138138 }
139139 }
gitoxide-core/src/pack/index.rs+1−1
@@ -85,7 +85,7 @@ pub fn from_pack( · 84 unmodified lines
8585 thread_limit: ctx.thread_limit,
8686 iteration_mode: ctx.iteration_mode.into(),
8787 index_kind: pack::index::Version::default(),
88− hash_kind: git_repository::hash::Kind::Sha1, // TODO: make this configurable via CLI, context
88+ object_hash: git_repository::hash::Kind::Sha1, // TODO: make this configurable via CLI, context
8989 };
9090 let out = ctx.out;
9191 let format = ctx.format;
gitoxide-core/src/pack/receive.rs+1−1
@@ -330,7 +330,7 @@ fn receive_pack_blocking<W: io::Write>( · 329 unmodified lines
330330 thread_limit: ctx.thread_limit,
331331 index_kind: pack::index::Version::V2,
332332 iteration_mode: pack::data::input::Mode::Verify,
333− hash_kind: git_repository::hash::Kind::Sha1, // TODO: make this configurable, but respect the server response as well.
333+ object_hash: git_repository::hash::Kind::Sha1, // TODO: make this configurable, but respect the server response as well.
334334 };
335335 let outcome =
336336 pack::Bundle::write_to_directory(input, directory.take(), progress, &ctx.should_interrupt, None, options)