Unified · Split
| @@ -110,7 +110,7 @@ impl PrepareFetch { · 109 unmodified lines | ||
| 110 | 110 | None => return Ok(()), |
| 111 | 111 | }; |
| 112 | 112 | |
| 113 | − let name = "HEAD".try_into().expect("valid"); | |
| 113 | + let name: git_ref::FullName = "HEAD".try_into().expect("valid"); | |
| 114 | 114 | let reflog_message = || LogChange { |
| 115 | 115 | mode: RefLog::AndReference, |
| 116 | 116 | force_create_reflog: false, |
| @@ -138,10 +138,21 @@ impl PrepareFetch { · 21 unmodified lines | ||
| 138 | 138 | expected: PreviousValue::Any, |
| 139 | 139 | new: Target::Symbolic(referent), |
| 140 | 140 | }, |
| 141 | − name, | |
| 141 | + name: name.clone(), | |
| 142 | 142 | deref: false, |
| 143 | 143 | }, |
| 144 | 144 | ])?; |
| 145 | + let mut log = reflog_message(); | |
| 146 | + log.mode = RefLog::Only; | |
| 147 | + repo.edit_reference(RefEdit { | |
| 148 | + change: git_ref::transaction::Change::Update { | |
| 149 | + log, | |
| 150 | + expected: PreviousValue::Any, | |
| 151 | + new: Target::Peeled(head_peeled_id.to_owned()), | |
| 152 | + }, | |
| 153 | + name, | |
| 154 | + deref: false, | |
| 155 | + })?; | |
| 145 | 156 | } |
| 146 | 157 | None => { |
| 147 | 158 | repo.edit_reference(RefEdit { |
| @@ -4,6 +4,7 @@ use crate::remote; · 3 unmodified lines | ||
| 4 | 4 | |
| 5 | 5 | #[cfg(feature = "blocking-network-client")] |
| 6 | 6 | mod blocking_io { |
| 7 | + use git_object::bstr::ByteSlice; | |
| 7 | 8 | use git_repository as git; |
| 8 | 9 | |
| 9 | 10 | use crate::remote; |
| @@ -75,8 +76,16 @@ mod blocking_io { · 65 unmodified lines | ||
| 75 | 76 | } |
| 76 | 77 | |
| 77 | 78 | let head = repo.head()?; |
| 78 | − // dbg!(tmp.into_path()); | |
| 79 | − // let _head_logs = head.log_iter().all()?.expect("log present").collect::<Vec<_>>(); | |
| 79 | + { | |
| 80 | + let mut logs = head.log_iter(); | |
| 81 | + let head_logs = logs.all()?.expect("log present").collect::<Result<Vec<_>, _>>()?; | |
| 82 | + assert_eq!(head_logs.len(), 1, "just created"); | |
| 83 | + let line = &head_logs[0]; | |
| 84 | + assert!(line.message.starts_with(b"clone: from "), "{:?} unexpected", line); | |
| 85 | + let path = git_path::from_bstr(line.message.rsplit(|b| *b == b' ').next().expect("path").as_bstr()); | |
| 86 | + assert!(path.is_absolute(), "{:?} must be absolute", path); | |
| 87 | + } | |
| 88 | + | |
| 80 | 89 | let referent = head.try_into_referent().expect("symbolic ref is present"); |
| 81 | 90 | assert!( |
| 82 | 91 | referent.id().object().is_ok(), |