rust/hg-core/src/dirstate/dirstate_tree/node.rs
changeset 45710 510995e249c0
parent 45608 423f17f94f35
child 45780 ae2873e92250
equal deleted inserted replaced
45709:91fafafd5a68 45710:510995e249c0
    55     ) -> InsertResult {
    55     ) -> InsertResult {
    56         let mut split = path.splitn(2, |&c| c == b'/');
    56         let mut split = path.splitn(2, |&c| c == b'/');
    57         let head = split.next().unwrap_or(b"");
    57         let head = split.next().unwrap_or(b"");
    58         let tail = split.next().unwrap_or(b"");
    58         let tail = split.next().unwrap_or(b"");
    59 
    59 
       
    60         // Are we're modifying the current file ? Is the the end of the path ?
       
    61         let is_current_file = tail.is_empty() && head.is_empty();
       
    62 
    60         if let NodeKind::File(file) = &mut self.kind {
    63         if let NodeKind::File(file) = &mut self.kind {
    61             if tail.is_empty() && head.is_empty() {
    64             if is_current_file {
    62                 // We're modifying the current file
       
    63                 let new = Self {
    65                 let new = Self {
    64                     kind: NodeKind::File(File {
    66                     kind: NodeKind::File(File {
    65                         entry: new_entry,
    67                         entry: new_entry,
    66                         ..file.clone()
    68                         ..file.clone()
    67                     }),
    69                     }),