Skip to content

Commit f409e4a

Browse files
committed
adapt to changes in git-protocol (#450)
1 parent d61eb2c commit f409e4a

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

gitoxide-core/src/pack/receive.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,9 @@ fn write_raw_refs(refs: &[Ref], directory: PathBuf) -> std::io::Result<()> {
321321
};
322322
for r in refs {
323323
let (path, content) = match r {
324-
Ref::Unborn { target } => (
325-
assure_dir_exists(&"HEAD".to_owned().into())?,
326-
format!("unborn HEAD: {}", target),
327-
),
324+
Ref::Unborn { full_ref_name, target } => {
325+
(assure_dir_exists(full_ref_name)?, format!("unborn HEAD: {}", target))
326+
}
328327
Ref::Symbolic {
329328
full_ref_name: path,
330329
target,

gitoxide-core/src/repository/remote.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ mod refs_impl {
230230
impl From<fetch::Ref> for JsonRef {
231231
fn from(value: fetch::Ref) -> Self {
232232
match value {
233-
fetch::Ref::Unborn { target } => JsonRef::Unborn {
234-
path: "HEAD".into(),
233+
fetch::Ref::Unborn { full_ref_name, target } => JsonRef::Unborn {
234+
path: full_ref_name.to_string(),
235235
target: target.to_string(),
236236
},
237237
fetch::Ref::Direct {
@@ -279,9 +279,9 @@ mod refs_impl {
279279
target,
280280
object,
281281
} => write!(&mut out, "{} {} symref-target:{}", object, path, target).map(|_| object.as_ref()),
282-
fetch::Ref::Unborn { target } => {
282+
fetch::Ref::Unborn { full_ref_name, target } => {
283283
static NULL: git::hash::ObjectId = git::hash::ObjectId::null(git::hash::Kind::Sha1);
284-
write!(&mut out, "unborn HEAD symref-target:{}", target).map(|_| NULL.as_ref())
284+
write!(&mut out, "unborn {} symref-target:{}", full_ref_name, target).map(|_| NULL.as_ref())
285285
}
286286
}
287287
}

0 commit comments

Comments
 (0)