Fossil SCM
An attempt to get the --autopush option of "fossil git export" to work with ssh.
Commit
cd212e80224a551031ac75d8d35744fe3657bfc0bcb483bd81dd0c87779423c4
Parent
c2cfaa6a720fed1…
1 file changed
+6
-2
+6
-2
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -1483,12 +1483,16 @@ | ||
| 1483 | 1483 | /* Optionally do a "git push" */ |
| 1484 | 1484 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1485 | 1485 | if( zPushUrl ){ |
| 1486 | 1486 | char *zPushCmd; |
| 1487 | 1487 | UrlData url; |
| 1488 | - url_parse_local(zPushUrl, 0, &url); | |
| 1489 | - zPushCmd = mprintf("git push --mirror %s", url.canonical); | |
| 1488 | + if( sqlite3_strglob("http*", zPushUrl)==0 ){ | |
| 1489 | + url_parse_local(zPushUrl, 0, &url); | |
| 1490 | + zPushCmd = mprintf("git push --mirror %s", url.canonical); | |
| 1491 | + }else{ | |
| 1492 | + zPushCmd = mprintf("git push --mirror %s", zPushUrl); | |
| 1493 | + } | |
| 1490 | 1494 | gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd); |
| 1491 | 1495 | fossil_free(zPushCmd); |
| 1492 | 1496 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1493 | 1497 | fossil_system(zPushCmd); |
| 1494 | 1498 | fossil_free(zPushCmd); |
| 1495 | 1499 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1483,12 +1483,16 @@ | |
| 1483 | /* Optionally do a "git push" */ |
| 1484 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1485 | if( zPushUrl ){ |
| 1486 | char *zPushCmd; |
| 1487 | UrlData url; |
| 1488 | url_parse_local(zPushUrl, 0, &url); |
| 1489 | zPushCmd = mprintf("git push --mirror %s", url.canonical); |
| 1490 | gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd); |
| 1491 | fossil_free(zPushCmd); |
| 1492 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1493 | fossil_system(zPushCmd); |
| 1494 | fossil_free(zPushCmd); |
| 1495 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1483,12 +1483,16 @@ | |
| 1483 | /* Optionally do a "git push" */ |
| 1484 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1485 | if( zPushUrl ){ |
| 1486 | char *zPushCmd; |
| 1487 | UrlData url; |
| 1488 | if( sqlite3_strglob("http*", zPushUrl)==0 ){ |
| 1489 | url_parse_local(zPushUrl, 0, &url); |
| 1490 | zPushCmd = mprintf("git push --mirror %s", url.canonical); |
| 1491 | }else{ |
| 1492 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1493 | } |
| 1494 | gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd); |
| 1495 | fossil_free(zPushCmd); |
| 1496 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1497 | fossil_system(zPushCmd); |
| 1498 | fossil_free(zPushCmd); |
| 1499 |