pub fn write_hash_object(filepath: &str) -> std::string::String {
    let file = fs::read(filepath).expect("Unable to read file");
    // Assume a valid UTF-8 file
    let content = str::from_utf8(&file).unwrap();

    let store = create_store(content);
    let hash = Sha1::from(store.as_bytes()).hexdigest();

    object_util::write_object_file(&hash, store.as_bytes());

    hash
}
/// Like `hash_object` returns the SHA1 hash of the passed file,
/// but also writes the object to the object database.
Like `hash_object` returns the SHA1 hash of the passed file,
but also writes the object to the object database.
Like ` hash_object ` returns the SHA1 hash of the passed file but also writes the object to the object database .
pub fn write_hash_object(filepath: &str) -> std::string::String {
    let file = fs::read(filepath).expect("Unable to read file");
    // Assume a valid UTF-8 file
    let content = str::from_utf8(&file).unwrap();
    let store = create_store(content);
    let hash = Sha1::from(store.as_bytes()).hexdigest();
    object_util::write_object_file(&hash, store.as_bytes());
    hash
}
pub fn write_hash_object ( filepath : & str ) -> std :: string :: String { let file = fs :: read ( filepath ) . expect ( " " ) ; // Assume a valid UTF-8 file let content = str :: from_utf8 ( & file ) . unwrap ( ) ; let store = create_store ( content ) ; let hash = Sha1 :: from ( store . as_bytes ( ) ) . hexdigest ( ) ; object_util :: write_object_file ( & hash , store . as_bytes ( ) ) ; hash }
Like `hash_object` returns the SHA1 hash of the passed file,
but also writes the object to the object database.
Like ` hash_object ` returns the SHA1 hash of the passed file but also writes the object to the object database .
filepath
&str
filepath
&str