Fossil SCM

Reverse ref name traversal because git refs may have forward-slashes

jmoger 2015-03-16 19:01 UTC trunk
Commit 3d9c87516051528c54e476b8939d6deafd1e2b2a
1 file changed +3 -2
+3 -2
--- src/import.c
+++ src/import.c
@@ -516,16 +516,17 @@
516516
** last commit that holds that tag.
517517
**
518518
** None of the above is explained in the git-fast-export
519519
** documentation. We had to figure it out via trial and error.
520520
*/
521
- for(i=strlen(z)-1; i>=0 && z[i]!='/'; i--){}
522
- gg.tagCommit = strncmp(&z[i-4], "tags", 4)==0; /* True for pattern B */
521
+ for(i=5; i<strlen(z) && z[i]!='/'; i++){}
522
+ gg.tagCommit = strncmp(&z[5], "tags", 4)==0; /* True for pattern B */
523523
if( z[i+1]!=0 ) z += i+1;
524524
if( fossil_strcmp(z, "master")==0 ) z = "trunk";
525525
gg.zBranch = fossil_strdup(z);
526526
gg.fromLoaded = 0;
527
+
527528
}else
528529
if( strncmp(zLine, "tag ", 4)==0 ){
529530
gg.xFinish();
530531
gg.xFinish = finish_tag;
531532
trim_newline(&zLine[4]);
532533
--- src/import.c
+++ src/import.c
@@ -516,16 +516,17 @@
516 ** last commit that holds that tag.
517 **
518 ** None of the above is explained in the git-fast-export
519 ** documentation. We had to figure it out via trial and error.
520 */
521 for(i=strlen(z)-1; i>=0 && z[i]!='/'; i--){}
522 gg.tagCommit = strncmp(&z[i-4], "tags", 4)==0; /* True for pattern B */
523 if( z[i+1]!=0 ) z += i+1;
524 if( fossil_strcmp(z, "master")==0 ) z = "trunk";
525 gg.zBranch = fossil_strdup(z);
526 gg.fromLoaded = 0;
 
527 }else
528 if( strncmp(zLine, "tag ", 4)==0 ){
529 gg.xFinish();
530 gg.xFinish = finish_tag;
531 trim_newline(&zLine[4]);
532
--- src/import.c
+++ src/import.c
@@ -516,16 +516,17 @@
516 ** last commit that holds that tag.
517 **
518 ** None of the above is explained in the git-fast-export
519 ** documentation. We had to figure it out via trial and error.
520 */
521 for(i=5; i<strlen(z) && z[i]!='/'; i++){}
522 gg.tagCommit = strncmp(&z[5], "tags", 4)==0; /* True for pattern B */
523 if( z[i+1]!=0 ) z += i+1;
524 if( fossil_strcmp(z, "master")==0 ) z = "trunk";
525 gg.zBranch = fossil_strdup(z);
526 gg.fromLoaded = 0;
527
528 }else
529 if( strncmp(zLine, "tag ", 4)==0 ){
530 gg.xFinish();
531 gg.xFinish = finish_tag;
532 trim_newline(&zLine[4]);
533

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button