Skip to content

Commit 6f3f710

Browse files
committed
Merge branch 'fc/remote-testgit-feature-done'
In the longer term, tightening rules is a good thing to do, and because nobody who has worked in the remote helper area seems to be interested in reviewing this, I would assume they do not think such a retroactive tightening will affect their remote helpers. So let's advance this topic to see what happens. * fc/remote-testgit-feature-done: remote-testgit: properly check for errors
2 parents e43171a + 6c32332 commit 6f3f710

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

git-remote-testpy.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ def do_import(repo, args):
164164
ref = line[7:].strip()
165165
refs.append(ref)
166166

167+
print "feature done"
168+
169+
if os.environ.get("GIT_REMOTE_TESTGIT_FAILURE"):
170+
die('Told to fail')
171+
167172
repo = update_local_repo(repo)
168173
repo.exporter.export_repo(repo.gitdir, refs)
169174

@@ -177,6 +182,9 @@ def do_export(repo, args):
177182
if not repo.gitdir:
178183
die("Need gitdir to export")
179184

185+
if os.environ.get("GIT_REMOTE_TESTGIT_FAILURE"):
186+
die('Told to fail')
187+
180188
update_local_repo(repo)
181189
changed = repo.importer.do_import(repo.gitdir)
182190

t/t5800-remote-testpy.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,25 @@ test_expect_failure 'push new branch with old:new refspec' '
145145
compare_refs clone HEAD server refs/heads/new-refspec
146146
'
147147

148+
test_expect_success 'proper failure checks for fetching' '
149+
(GIT_REMOTE_TESTGIT_FAILURE=1 &&
150+
export GIT_REMOTE_TESTGIT_FAILURE &&
151+
cd localclone &&
152+
test_must_fail git fetch 2>&1 | \
153+
grep "Error while running fast-import"
154+
)
155+
'
156+
157+
# We sleep to give fast-export a chance to catch the SIGPIPE
158+
test_expect_failure 'proper failure checks for pushing' '
159+
(GIT_REMOTE_TESTGIT_FAILURE=1 &&
160+
export GIT_REMOTE_TESTGIT_FAILURE &&
161+
GIT_REMOTE_TESTGIT_SLEEPY=1 &&
162+
export GIT_REMOTE_TESTGIT_SLEEPY &&
163+
cd localclone &&
164+
test_must_fail git push --all 2>&1 | \
165+
grep "Error while running fast-export"
166+
)
167+
'
168+
148169
test_done

0 commit comments

Comments
 (0)