ok/jj
1
0
Fork 0
forked from mirrors/jj

git_backend: use .strip_suffix() instead of manual slicing

This commit is contained in:
Yuya Nishihara 2023-10-30 15:09:28 +09:00
parent 9bd84c55e0
commit f5aa739c70

View file

@ -604,9 +604,9 @@ impl Backend for GitBackend {
}
0o100644 => {
let id = FileId::from_bytes(entry.id().as_bytes());
if name.ends_with(CONFLICT_SUFFIX) {
if let Some(basename) = name.strip_suffix(CONFLICT_SUFFIX) {
(
&name[0..name.len() - CONFLICT_SUFFIX.len()],
basename,
TreeValue::Conflict(ConflictId::from_bytes(entry.id().as_bytes())),
)
} else {