use crate::repo::Change;
pub struct FastExportStream {
pub branch_name: String,
}
impl FastExportStream {
pub fn write_commit(&mut self, c: &Change) {
println!("commit refs/heads/{}", self.branch_name);
// TODO: mark
let committer = if c.authors.len() > 0 {
&c.authors[0]
} else {
"<>"
};
println!("committer {} {} +0000", committer, c.timestamp.timestamp());
let message = match &c.description {
Some(description) => format!("{}\n\n{}", c.message, description),
None => c.message.to_string(),
};
println!("data {}", message.len());
println!("{}", message);
// TODO: from
// TODO: deleteall
// TODO: files
println!("");
}
}