P4XQYHU5FXCXXQ6G3IY6E6MNSHJWPLRGZRQO35XK4IYFH5PCFK6QC
W3VW7MJEFLG23XF3IEOLRB2L644NZN2R2L7RS6TVMRUEPSZFETLAC
WOYAD3FWIOSSZLM76DX6ZCRG6YILONICJ25UYMOJ52BGRLRPGRGAC
K7M77GF5ILC4KKKYPTLZRZ2OND7DOQDQNRYKM3N6XV2DMJURYA3QC
EEBZMKMLEADO3ODXOQ7VNZNT36L7BYFRQUS2S2HLDVBZI7FHZQFQC
VEN5WJYRT23IT77JAAZ5CJRSW3GUTTNMAECT3WVTHQA34HI4646AC
4LR5AJ4AX277G4G3SRDHNCIJIOCRZ6I4TUNTSZOAVUX4MW5GYFTQC
5WTKSBFRO522ILOHTH5OII4EES3DMLWMTA47PXCVWCIGMXIS77KAC
F2QYIRKBFYFWSTB7Z5CNGSZVYI6XQO3MHPUHJLBHPGLIOG7UNVNQC
self.commit(format!("add entry from {:?}", entry.hostname))?;
Ok(())
}
pub fn commit(&self, message: impl AsRef<str>) -> Result<(), Error> {
if !&self.data_dir.join(".git").exists() {
Command::new("git")
.arg("init")
.current_dir(&self.data_dir)
.output()
.map_err(Error::GitInit)?;
}
Command::new("git")
.arg("add")
.arg(":/")
.current_dir(&self.data_dir)
.output()
.map_err(Error::GitAdd)?;
Command::new("git")
.arg("commit")
.arg("-m")
.arg(message.as_ref())
.current_dir(&self.data_dir)
.output()
.map_err(Error::GitCommit)?;