Fossil SCM

When the "fossil git export" command displays the "git push" command it is about to run, omit the display of any password that happens to be embedded in the URL.

drh 2019-03-16 13:58 trunk
Commit aaa937a8e14ec049e7b172aa32eff4dfcd9d31b6999e0988537488a07cc3f15f
1 file changed +6 -1
+6 -1
--- src/export.c
+++ src/export.c
@@ -1392,12 +1392,17 @@
13921392
db_commit_transaction();
13931393
13941394
/* Optionally do a "git push" */
13951395
zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'");
13961396
if( zPushUrl ){
1397
- char *zPushCmd = mprintf("git push --mirror %s", zPushUrl);
1397
+ char *zPushCmd;
1398
+ UrlData url;
1399
+ url_parse_local(zPushUrl, 0, &url);
1400
+ zPushCmd = mprintf("git push --mirror %s", url.canonical);
13981401
fossil_print("%s\n", zPushCmd);
1402
+ fossil_free(zPushCmd);
1403
+ zPushCmd = mprintf("git push --mirror %s", zPushUrl);
13991404
fossil_system(zPushCmd);
14001405
fossil_free(zPushCmd);
14011406
}
14021407
}
14031408
14041409
--- src/export.c
+++ src/export.c
@@ -1392,12 +1392,17 @@
1392 db_commit_transaction();
1393
1394 /* Optionally do a "git push" */
1395 zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'");
1396 if( zPushUrl ){
1397 char *zPushCmd = mprintf("git push --mirror %s", zPushUrl);
 
 
 
1398 fossil_print("%s\n", zPushCmd);
 
 
1399 fossil_system(zPushCmd);
1400 fossil_free(zPushCmd);
1401 }
1402 }
1403
1404
--- src/export.c
+++ src/export.c
@@ -1392,12 +1392,17 @@
1392 db_commit_transaction();
1393
1394 /* Optionally do a "git push" */
1395 zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'");
1396 if( zPushUrl ){
1397 char *zPushCmd;
1398 UrlData url;
1399 url_parse_local(zPushUrl, 0, &url);
1400 zPushCmd = mprintf("git push --mirror %s", url.canonical);
1401 fossil_print("%s\n", zPushCmd);
1402 fossil_free(zPushCmd);
1403 zPushCmd = mprintf("git push --mirror %s", zPushUrl);
1404 fossil_system(zPushCmd);
1405 fossil_free(zPushCmd);
1406 }
1407 }
1408
1409

Keyboard Shortcuts

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