Skip to content

Commit

Permalink
adapt to changes in git-protocol (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Nov 2, 2022
1 parent d61eb2c commit f409e4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions gitoxide-core/src/pack/receive.rs
Expand Up @@ -321,10 +321,9 @@ fn write_raw_refs(refs: &[Ref], directory: PathBuf) -> std::io::Result<()> {
};
for r in refs {
let (path, content) = match r {
Ref::Unborn { target } => (
assure_dir_exists(&"HEAD".to_owned().into())?,
format!("unborn HEAD: {}", target),
),
Ref::Unborn { full_ref_name, target } => {
(assure_dir_exists(full_ref_name)?, format!("unborn HEAD: {}", target))
}
Ref::Symbolic {
full_ref_name: path,
target,
Expand Down
8 changes: 4 additions & 4 deletions gitoxide-core/src/repository/remote.rs
Expand Up @@ -230,8 +230,8 @@ mod refs_impl {
impl From<fetch::Ref> for JsonRef {
fn from(value: fetch::Ref) -> Self {
match value {
fetch::Ref::Unborn { target } => JsonRef::Unborn {
path: "HEAD".into(),
fetch::Ref::Unborn { full_ref_name, target } => JsonRef::Unborn {
path: full_ref_name.to_string(),
target: target.to_string(),
},
fetch::Ref::Direct {
Expand Down Expand Up @@ -279,9 +279,9 @@ mod refs_impl {
target,
object,
} => write!(&mut out, "{} {} symref-target:{}", object, path, target).map(|_| object.as_ref()),
fetch::Ref::Unborn { target } => {
fetch::Ref::Unborn { full_ref_name, target } => {
static NULL: git::hash::ObjectId = git::hash::ObjectId::null(git::hash::Kind::Sha1);
write!(&mut out, "unborn HEAD symref-target:{}", target).map(|_| NULL.as_ref())
write!(&mut out, "unborn {} symref-target:{}", full_ref_name, target).map(|_| NULL.as_ref())
}
}
}
Expand Down

0 comments on commit f409e4a

Please sign in to comment.