Fossil SCM
Fix a bug in the merge file-rename detection logic, a bug introduced by the path refactoring changes.
Commit
66951fa6bd0d7a93a5ee8ac807391de4b2d8903c
Parent
e5121b4762eea03…
1 file changed
+5
-1
+5
-1
| --- src/path.c | ||
| +++ src/path.c | ||
| @@ -126,11 +126,14 @@ | ||
| 126 | 126 | PathNode *pPrev; |
| 127 | 127 | PathNode *p; |
| 128 | 128 | |
| 129 | 129 | path_reset(); |
| 130 | 130 | path.pStart = path_new_node(iFrom, 0, 0); |
| 131 | - if( iTo==iFrom ) return path.pStart; | |
| 131 | + if( iTo==iFrom ){ | |
| 132 | + path.pEnd = path.pStart; | |
| 133 | + return path.pStart; | |
| 134 | + } | |
| 132 | 135 | if( directOnly ){ |
| 133 | 136 | db_prepare(&s, |
| 134 | 137 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim " |
| 135 | 138 | "UNION ALL " |
| 136 | 139 | "SELECT pid, 0 FROM plink WHERE cid=:pid AND isprim" |
| @@ -360,10 +363,11 @@ | ||
| 360 | 363 | int i; /* Loop counter */ |
| 361 | 364 | Stmt q1; /* Query of name changes */ |
| 362 | 365 | |
| 363 | 366 | *pnChng = 0; |
| 364 | 367 | *aiChng = 0; |
| 368 | + if( iFrom==iTo ) return; | |
| 365 | 369 | path_reset(); |
| 366 | 370 | p = path_shortest(iFrom, iTo, 0); |
| 367 | 371 | if( p==0 ) return; |
| 368 | 372 | path_reverse_path(); |
| 369 | 373 | db_prepare(&q1, |
| 370 | 374 |
| --- src/path.c | |
| +++ src/path.c | |
| @@ -126,11 +126,14 @@ | |
| 126 | PathNode *pPrev; |
| 127 | PathNode *p; |
| 128 | |
| 129 | path_reset(); |
| 130 | path.pStart = path_new_node(iFrom, 0, 0); |
| 131 | if( iTo==iFrom ) return path.pStart; |
| 132 | if( directOnly ){ |
| 133 | db_prepare(&s, |
| 134 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim " |
| 135 | "UNION ALL " |
| 136 | "SELECT pid, 0 FROM plink WHERE cid=:pid AND isprim" |
| @@ -360,10 +363,11 @@ | |
| 360 | int i; /* Loop counter */ |
| 361 | Stmt q1; /* Query of name changes */ |
| 362 | |
| 363 | *pnChng = 0; |
| 364 | *aiChng = 0; |
| 365 | path_reset(); |
| 366 | p = path_shortest(iFrom, iTo, 0); |
| 367 | if( p==0 ) return; |
| 368 | path_reverse_path(); |
| 369 | db_prepare(&q1, |
| 370 |
| --- src/path.c | |
| +++ src/path.c | |
| @@ -126,11 +126,14 @@ | |
| 126 | PathNode *pPrev; |
| 127 | PathNode *p; |
| 128 | |
| 129 | path_reset(); |
| 130 | path.pStart = path_new_node(iFrom, 0, 0); |
| 131 | if( iTo==iFrom ){ |
| 132 | path.pEnd = path.pStart; |
| 133 | return path.pStart; |
| 134 | } |
| 135 | if( directOnly ){ |
| 136 | db_prepare(&s, |
| 137 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim " |
| 138 | "UNION ALL " |
| 139 | "SELECT pid, 0 FROM plink WHERE cid=:pid AND isprim" |
| @@ -360,10 +363,11 @@ | |
| 363 | int i; /* Loop counter */ |
| 364 | Stmt q1; /* Query of name changes */ |
| 365 | |
| 366 | *pnChng = 0; |
| 367 | *aiChng = 0; |
| 368 | if( iFrom==iTo ) return; |
| 369 | path_reset(); |
| 370 | p = path_shortest(iFrom, iTo, 0); |
| 371 | if( p==0 ) return; |
| 372 | path_reverse_path(); |
| 373 | db_prepare(&q1, |
| 374 |