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.
Commit
aaa937a8e14ec049e7b172aa32eff4dfcd9d31b6999e0988537488a07cc3f15f
Parent
df619db6e42f82b…
1 file changed
+6
-1
+6
-1
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -1392,12 +1392,17 @@ | ||
| 1392 | 1392 | db_commit_transaction(); |
| 1393 | 1393 | |
| 1394 | 1394 | /* Optionally do a "git push" */ |
| 1395 | 1395 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1396 | 1396 | 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); | |
| 1398 | 1401 | fossil_print("%s\n", zPushCmd); |
| 1402 | + fossil_free(zPushCmd); | |
| 1403 | + zPushCmd = mprintf("git push --mirror %s", zPushUrl); | |
| 1399 | 1404 | fossil_system(zPushCmd); |
| 1400 | 1405 | fossil_free(zPushCmd); |
| 1401 | 1406 | } |
| 1402 | 1407 | } |
| 1403 | 1408 | |
| 1404 | 1409 |
| --- 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 |