| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 98f6995 commit 723f100
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -232,7 +232,13 @@ def remote_repo_creator(self): | |||
| 232 | 232 | prev_cwd = os.getcwd() | |
| 233 | 233 | os.chdir(rw_repo.working_dir) | |
| 234 | 234 | try: | |
| 235 | - return func(self, rw_repo, rw_remote_repo) | ||
| 235 | + try: | ||
| 236 | + return func(self, rw_repo, rw_remote_repo) | ||
| 237 | + except: | ||
| 238 | + print("Keeping repos after failure: repo_dir = %s, remote_repo_dir = %s" | ||
| 239 | + % (repo_dir, remote_repo_dir), file=sys.stderr) | ||
| 240 | + repo_dir = remote_repo_dir = None | ||
| 241 | + raise | ||
| 236 | 242 | finally: | |
| 237 | 243 | # gd.proc.kill() ... no idea why that doesn't work | |
| 238 | 244 | if gd is not None: | |
@@ -241,8 +247,10 @@ def remote_repo_creator(self): | |||
| 241 | 247 | os.chdir(prev_cwd) | |
| 242 | 248 | rw_repo.git.clear_cache() | |
| 243 | 249 | rw_remote_repo.git.clear_cache() | |
| 244 | - shutil.rmtree(repo_dir, onerror=_rmtree_onerror) | ||
| 245 | - shutil.rmtree(remote_repo_dir, onerror=_rmtree_onerror) | ||
| 250 | + if repo_dir: | ||
| 251 | + shutil.rmtree(repo_dir, onerror=_rmtree_onerror) | ||
| 252 | + if remote_repo_dir: | ||
| 253 | + shutil.rmtree(remote_repo_dir, onerror=_rmtree_onerror) | ||
| 246 | 254 | ||
| 247 | 255 | if gd is not None: | |
| 248 | 256 | gd.proc.wait() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -159,6 +159,23 @@ def finalize_process(proc): | |||
| 159 | 159 | except GitCommandError: | |
| 160 | 160 | # if a push has rejected items, the command has non-zero return status | |
| 161 | 161 | # a return status of 128 indicates a connection error - reraise the previous one | |
| 162 | + # Everything else will still be parsed and made available through PushInfo flags | ||
| 163 | + # Estimated error results look like this: | ||
| 164 | + # ```bash | ||
| 165 | + # To /var/folders/xp/m48gs2tx2vg95tmtzw7tprs40000gn/T/tmpk5jeBeremote_repo_test_base | ||
| 166 | + # ! refs/heads/master:refs/heads/master [rejected] (non-fast-forward) | ||
| 167 | + # Done | ||
| 168 | + # error: failed to push some refs to | ||
| 169 | + # '/var/folders/xp/m48gs2tx2vg95tmtzw7tprs40000gn/T/tmpk5jeBeremote_repo_test_base' | ||
| 170 | + # hint: Updates were rejected because the tip of your current branch is behind | ||
| 171 | + # hint: its remote counterpart. Integrate the remote changes (e.g. | ||
| 172 | + # hint: 'git pull ...') before pushing again. | ||
| 173 | + # hint: See the 'Note about fast-forwards' in 'git push --help' for details. | ||
| 174 | + # ``` | ||
| 175 | + # See https://github.com/gitpython-developers/GitPython/blob/master/git/test/test_remote.py#L305 | ||
| 176 | + # on how to check for these kinds of errors. | ||
| 177 | + # Also see this issue for a reason for this verbosity: | ||
| 178 | + # https://github.com/gitpython-developers/GitPython/issues/271 | ||
| 162 | 179 | if proc.poll() == 128: | |
| 163 | 180 | raise | |
| 164 | 181 | pass | |
| Back | FazBrowse Home | New Git URL |
0 commit comments