mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-07-06 03:06:05 +08:00
fix:去除current_head()返回值中的\n
\n会导致文件写入失败
This commit is contained in:
@@ -170,7 +170,7 @@ impl Index {
|
||||
pub fn get_tracked_files(&self) -> Vec<PathBuf> {
|
||||
let mut files = Vec::new();
|
||||
self.entries.keys().for_each(|file| {
|
||||
if file.exists() {
|
||||
if file.exists() { //todo: cancel this check
|
||||
files.push(file.clone());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -141,7 +141,7 @@ impl Tree {
|
||||
let mut blobs = Vec::new();
|
||||
for entry in self.entries.iter() {
|
||||
if entry.filemode.0 == "blob" {
|
||||
let blob = super::blob::Blob::load(&entry.object_hash);
|
||||
let blob = super::blob::Blob::load(&entry.object_hash); //todo: hash only
|
||||
blobs.push((PathBuf::from(entry.name.clone()), blob));
|
||||
} else {
|
||||
let sub_tree = Tree::load(&entry.object_hash);
|
||||
@@ -151,7 +151,7 @@ impl Tree {
|
||||
sub_blobs
|
||||
.iter()
|
||||
.map(|(path, blob)| {
|
||||
(PathBuf::from(entry.name.clone()).join(path), blob.clone())
|
||||
(PathBuf::from(entry.name.clone()).join(path), blob.clone()) //todo: why join?
|
||||
})
|
||||
.collect::<Vec<(PathBuf, super::blob::Blob)>>()
|
||||
.as_mut(),
|
||||
|
||||
Reference in New Issue
Block a user