Fossil SCM
Fix the "fossil git export" command so that it returns a non-zero exit code if the "git push" command fails.
Commit
da5faf18c3699d5c521695aed2e6069568e374111a2228de231984d1b255c5fe
Parent
daf8ab95cd19afb…
1 file changed
+5
-2
+5
-2
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -1324,11 +1324,11 @@ | ||
| 1324 | 1324 | /* Create a new Git repository at zMirror */ |
| 1325 | 1325 | zCmd = mprintf("git init %$", zMirror); |
| 1326 | 1326 | gitmirror_message(VERB_NORMAL, "%s\n", zCmd); |
| 1327 | 1327 | rc = fossil_system(zCmd); |
| 1328 | 1328 | if( rc ){ |
| 1329 | - fossil_fatal("cannot initialize git repository using: %s\n", zCmd); | |
| 1329 | + fossil_fatal("cannot initialize git repository using: %s", zCmd); | |
| 1330 | 1330 | } |
| 1331 | 1331 | fossil_free(zCmd); |
| 1332 | 1332 | |
| 1333 | 1333 | /* Must be in the new Git repository directory for subsequent commands */ |
| 1334 | 1334 | rc = file_chdir(zMirror, 0); |
| @@ -1718,11 +1718,14 @@ | ||
| 1718 | 1718 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1719 | 1719 | } |
| 1720 | 1720 | gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd); |
| 1721 | 1721 | fossil_free(zPushCmd); |
| 1722 | 1722 | zPushCmd = mprintf("git push --mirror %$", zPushUrl); |
| 1723 | - fossil_system(zPushCmd); | |
| 1723 | + rc = fossil_system(zPushCmd); | |
| 1724 | + if( rc ){ | |
| 1725 | + fossil_fatal("cannot push content using: %s", zPushCmd); | |
| 1726 | + } | |
| 1724 | 1727 | fossil_free(zPushCmd); |
| 1725 | 1728 | } |
| 1726 | 1729 | } |
| 1727 | 1730 | |
| 1728 | 1731 | /* |
| 1729 | 1732 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1324,11 +1324,11 @@ | |
| 1324 | /* Create a new Git repository at zMirror */ |
| 1325 | zCmd = mprintf("git init %$", zMirror); |
| 1326 | gitmirror_message(VERB_NORMAL, "%s\n", zCmd); |
| 1327 | rc = fossil_system(zCmd); |
| 1328 | if( rc ){ |
| 1329 | fossil_fatal("cannot initialize git repository using: %s\n", zCmd); |
| 1330 | } |
| 1331 | fossil_free(zCmd); |
| 1332 | |
| 1333 | /* Must be in the new Git repository directory for subsequent commands */ |
| 1334 | rc = file_chdir(zMirror, 0); |
| @@ -1718,11 +1718,14 @@ | |
| 1718 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1719 | } |
| 1720 | gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd); |
| 1721 | fossil_free(zPushCmd); |
| 1722 | zPushCmd = mprintf("git push --mirror %$", zPushUrl); |
| 1723 | fossil_system(zPushCmd); |
| 1724 | fossil_free(zPushCmd); |
| 1725 | } |
| 1726 | } |
| 1727 | |
| 1728 | /* |
| 1729 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1324,11 +1324,11 @@ | |
| 1324 | /* Create a new Git repository at zMirror */ |
| 1325 | zCmd = mprintf("git init %$", zMirror); |
| 1326 | gitmirror_message(VERB_NORMAL, "%s\n", zCmd); |
| 1327 | rc = fossil_system(zCmd); |
| 1328 | if( rc ){ |
| 1329 | fossil_fatal("cannot initialize git repository using: %s", zCmd); |
| 1330 | } |
| 1331 | fossil_free(zCmd); |
| 1332 | |
| 1333 | /* Must be in the new Git repository directory for subsequent commands */ |
| 1334 | rc = file_chdir(zMirror, 0); |
| @@ -1718,11 +1718,14 @@ | |
| 1718 | zPushCmd = mprintf("git push --mirror %s", zPushUrl); |
| 1719 | } |
| 1720 | gitmirror_message(VERB_NORMAL, "%s\n", zPushCmd); |
| 1721 | fossil_free(zPushCmd); |
| 1722 | zPushCmd = mprintf("git push --mirror %$", zPushUrl); |
| 1723 | rc = fossil_system(zPushCmd); |
| 1724 | if( rc ){ |
| 1725 | fossil_fatal("cannot push content using: %s", zPushCmd); |
| 1726 | } |
| 1727 | fossil_free(zPushCmd); |
| 1728 | } |
| 1729 | } |
| 1730 | |
| 1731 | /* |
| 1732 |