Fossil SCM
Improved handling of tag names in "import --git".
Commit
3270562fe0b7aff565ed5d75d95cbe1ca48ffa10
Parent
127ee1f57234058…
1 file changed
+2
-2
+2
-2
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -516,12 +516,12 @@ | ||
| 516 | 516 | ** last commit that holds that tag. |
| 517 | 517 | ** |
| 518 | 518 | ** None of the above is explained in the git-fast-export |
| 519 | 519 | ** documentation. We had to figure it out via trial and error. |
| 520 | 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 */ | |
| 521 | + for(i=5; i<strlen(z) && z[i]!='/'; i++){} | |
| 522 | + gg.tagCommit = strncmp(&z[5], "tags", 4)==0; /* True for pattern B */ | |
| 523 | 523 | if( z[i+1]!=0 ) z += i+1; |
| 524 | 524 | if( fossil_strcmp(z, "master")==0 ) z = "trunk"; |
| 525 | 525 | gg.zBranch = fossil_strdup(z); |
| 526 | 526 | gg.fromLoaded = 0; |
| 527 | 527 | }else |
| 528 | 528 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -516,12 +516,12 @@ | |
| 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 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -516,12 +516,12 @@ | |
| 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 | }else |
| 528 |