Skip to content

Commit

Permalink
Fixes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhexists committed Dec 17, 2023
1 parent 6ad62c2 commit ee19d05
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/commands/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ fn handle_commit(dir_path: &Path) -> io::Result<Vec<TreeEntry>> {
File::create(file_path)?;
let _ = file.write_all(&compressed_content);
entries.push(TreeEntry {
name: "".to_string(),
name: entry_name
.to_str()
.unwrap()
.to_string(),
object: GitObject::Tree(sub_dir_tree),
hashed_path: hashed_tree_string,
});
Expand Down Expand Up @@ -113,8 +116,7 @@ fn handle_commit(dir_path: &Path) -> io::Result<Vec<TreeEntry>> {
let mut file: File = File::create(file_path)?;
let _ = file.write_all(&compressed_content);
entries.push(TreeEntry {
// Enter file Name here
name: "".to_string(),
name: entry_name.to_str().unwrap().to_string(),
object: GitObject::Blob(file_blob),
hashed_path: hashed_blob_string,
});
Expand Down

0 comments on commit ee19d05

Please sign in to comment.