Tag check
Dependencies
- [2]
IQWG3UP4Fixing a bug in tag restore - [3]
L3RCAPPKAdd --repository to tag commands - [4]
G6UIBL6UCleaner error handling for tag deserialization - [5]
ZDK3GNDBTag transactions (including a massive refactoring of errors) - [6]
QL6K2ZM3Tags - [7]
5OGOE4VWStore the current channel in the pristine - [8]
AAXP2534Tags: completing the subcommand - [9]
FZ7MXL3BAllow to use short tag hashes - [10]
EUZFFJSOUpdating Pijul with the latest changes in Libpijul
Change contents
- replacement in pijul/src/commands/tag.rs at line 104
let mut tag_path = repo.path.join(libpijul::DOT_DIR);tag_path.push("tags");let mut tag_path = repo.changes_dir.clone(); - replacement in pijul/src/commands/tag.rs at line 108
temp_path.push("tag");temp_path.push("tmp"); - edit in pijul/src/commands/tag.rs at line 114
tag_path.set_extension("tag"); - replacement in pijul/src/commands/tag.rs at line 128
let mut tag_path = repo.path.join(libpijul::DOT_DIR);tag_path.push("tags");let mut tag_path = repo.changes_dir.clone(); - edit in pijul/src/commands/tag.rs at line 131
tag_path.set_extension("tag"); - replacement in pijul/src/commands/tag.rs at line 147
let f = libpijul::tag::OpenTagFile::open(&tag_path)?;let mut f = libpijul::tag::OpenTagFile::open(&tag_path)?;f.check(&h)?; - replacement in pijul/src/commands/tag.rs at line 155
let mut tag_path = repo.path.join(libpijul::DOT_DIR);tag_path.push("tags");let mut tag_path = repo.changes_dir.clone(); - edit in pijul/src/commands/tag.rs at line 158
tag_path.set_extension("tag"); - replacement in pijul/src/commands/tag.rs at line 164
let tag = libpijul::tag::txn::TagTxn::new(&tag_path)?;let tag = libpijul::tag::txn::TagTxn::new(&tag_path, &h)?; - replacement in pijul/src/commands/tag.rs at line 200
let mut tag_path = repo.path.join(libpijul::DOT_DIR);tag_path.push("tags");let mut tag_path = repo.changes_dir.clone(); - edit in pijul/src/commands/tag.rs at line 206
tag_path.set_extension("tag"); - edit in libpijul/src/tag.rs at line 60
#[error("Wrong hash, expected {}, got {}", expected.to_base32(), got.to_base32())]WrongHash { expected: Hash, got: Hash }, - edit in libpijul/src/tag.rs at line 97
pub fn check(&mut self, expected: &Hash) -> Result<(), TagError> {let mut hasher = Hasher::default();self.file.seek(SeekFrom::Start(0))?;let mut buf = Vec::new();// Reading the FileHeaderbuf.resize(self.header.header as usize, 0);self.file.read_exact(&mut buf)?;hasher.update(&buf);// Reading the Headerbuf.resize((self.header.channel - self.header.header) as usize, 0);self.file.read_exact(&mut buf)?;hasher.update(&buf);// Reading the Headerbuf.resize((self.header.unhashed - self.header.channel) as usize, 0);self.file.read_exact(&mut buf)?;hasher.update(&buf);let got = hasher.finish();if &got != expected {Err(TagError::WrongHash {expected: *expected,got,})} else {Ok(())}}