Fossil SCM
In git export/status, apply the same URL logic as [076b7694046c4] to avoid attempting to URL-parse git@... URLs and gracefully handle scp aliases which start with 'http'.
Commit
b500e561aa053ec4f4cd52987e4d023dacd90cef5bb3c7e0b7f83926eb1ef528
Parent
3c20bf3c70daf51…
1 file changed
+6
-2
+6
-2
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -1718,11 +1718,13 @@ | ||
| 1718 | 1718 | /* Optionally do a "git push" */ |
| 1719 | 1719 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1720 | 1720 | if( zPushUrl ){ |
| 1721 | 1721 | char *zPushCmd; |
| 1722 | 1722 | UrlData url; |
| 1723 | - if( sqlite3_strglob("http*", zPushUrl)==0 ){ | |
| 1723 | + if( fossil_strnicmp(zPushUrl, "http://", 7)==0 | |
| 1724 | + || fossil_strnicmp(zPushUrl, "https://", 8)==0 | |
| 1725 | + ){ | |
| 1724 | 1726 | url_parse_local(zPushUrl, 0, &url); |
| 1725 | 1727 | zPushCmd = mprintf("git push --mirror %s", url.canonical); |
| 1726 | 1728 | }else{ |
| 1727 | 1729 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1728 | 1730 | } |
| @@ -1801,11 +1803,13 @@ | ||
| 1801 | 1803 | z = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1802 | 1804 | if( z==0 ){ |
| 1803 | 1805 | fossil_print("Autopush: off\n"); |
| 1804 | 1806 | }else{ |
| 1805 | 1807 | UrlData url; |
| 1806 | - if( sqlite3_strglob("http*", z)==0 ){ | |
| 1808 | + if( fossil_strnicmp(z, "http://", 7)==0 | |
| 1809 | + || fossil_strnicmp(z, "https://", 8)==0 | |
| 1810 | + ){ | |
| 1807 | 1811 | url_parse_local(z, 0, &url); |
| 1808 | 1812 | fossil_print("Autopush: %s\n", url.canonical); |
| 1809 | 1813 | }else{ |
| 1810 | 1814 | fossil_print("Autopush: %s\n", z); |
| 1811 | 1815 | } |
| 1812 | 1816 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1718,11 +1718,13 @@ | |
| 1718 | /* Optionally do a "git push" */ |
| 1719 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1720 | if( zPushUrl ){ |
| 1721 | char *zPushCmd; |
| 1722 | UrlData url; |
| 1723 | if( sqlite3_strglob("http*", zPushUrl)==0 ){ |
| 1724 | url_parse_local(zPushUrl, 0, &url); |
| 1725 | zPushCmd = mprintf("git push --mirror %s", url.canonical); |
| 1726 | }else{ |
| 1727 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1728 | } |
| @@ -1801,11 +1803,13 @@ | |
| 1801 | z = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1802 | if( z==0 ){ |
| 1803 | fossil_print("Autopush: off\n"); |
| 1804 | }else{ |
| 1805 | UrlData url; |
| 1806 | if( sqlite3_strglob("http*", z)==0 ){ |
| 1807 | url_parse_local(z, 0, &url); |
| 1808 | fossil_print("Autopush: %s\n", url.canonical); |
| 1809 | }else{ |
| 1810 | fossil_print("Autopush: %s\n", z); |
| 1811 | } |
| 1812 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1718,11 +1718,13 @@ | |
| 1718 | /* Optionally do a "git push" */ |
| 1719 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1720 | if( zPushUrl ){ |
| 1721 | char *zPushCmd; |
| 1722 | UrlData url; |
| 1723 | if( fossil_strnicmp(zPushUrl, "http://", 7)==0 |
| 1724 | || fossil_strnicmp(zPushUrl, "https://", 8)==0 |
| 1725 | ){ |
| 1726 | url_parse_local(zPushUrl, 0, &url); |
| 1727 | zPushCmd = mprintf("git push --mirror %s", url.canonical); |
| 1728 | }else{ |
| 1729 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1730 | } |
| @@ -1801,11 +1803,13 @@ | |
| 1803 | z = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1804 | if( z==0 ){ |
| 1805 | fossil_print("Autopush: off\n"); |
| 1806 | }else{ |
| 1807 | UrlData url; |
| 1808 | if( fossil_strnicmp(z, "http://", 7)==0 |
| 1809 | || fossil_strnicmp(z, "https://", 8)==0 |
| 1810 | ){ |
| 1811 | url_parse_local(z, 0, &url); |
| 1812 | fossil_print("Autopush: %s\n", url.canonical); |
| 1813 | }else{ |
| 1814 | fossil_print("Autopush: %s\n", z); |
| 1815 | } |
| 1816 |