fix init when cloning in the right dir

This commit is contained in:
grimhilt
2023-06-06 15:35:53 +02:00
parent 3b629f6de7
commit 457dd32ad8
3 changed files with 10 additions and 6 deletions

View File

@@ -30,6 +30,7 @@ pub fn add_line(line: String) -> io::Result<()> {
Some(path) => path,
None => todo!(),
};
dbg!(root.clone());
root.push(".nextsync");
root.push("HEAD");

View File

@@ -1,4 +1,5 @@
use std::path::Path;
use std::path::PathBuf;
use crate::utils::{head, path};
use crypto::sha1::Sha1;
use crypto::digest::Digest;
@@ -6,7 +7,7 @@ use std::fs::{OpenOptions, self};
use std::io::Write;
use std::io;
pub fn add_tree(path: &Path) {
pub fn add_tree(path: &Path, src: Option<PathBuf>) {
dbg!(path.clone());
let file_name = path.file_name().unwrap().to_str().unwrap();
let mut hasher = Sha1::new();