Fossil SCM

An attempt to get the --autopush option of "fossil git export" to work with ssh.

drh 2019-03-20 12:34 trunk
Commit cd212e80224a551031ac75d8d35744fe3657bfc0bcb483bd81dd0c87779423c4
1 file changed +6 -2
+6 -2
--- src/export.c
+++ src/export.c
@@ -1483,12 +1483,16 @@
14831483
/* Optionally do a "git push" */
14841484
zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'");
14851485
if( zPushUrl ){
14861486
char *zPushCmd;
14871487
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
+ }
14901494
gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd);
14911495
fossil_free(zPushCmd);
14921496
zPushCmd = mprintf("git push --mirror %s", zPushUrl);
14931497
fossil_system(zPushCmd);
14941498
fossil_free(zPushCmd);
14951499
--- 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

Keyboard Shortcuts

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