Browse Source
Add tests to check the behavior of fetching from a repository which changes between rounds of negotiation (for example, when different servers in a load-balancing agreement participate in the same stateless RPC negotiation). This forms a baseline of comparison to the ref-in-want functionality (which will be introduced to the client in subsequent commits), and ensures that subsequent commits do not change existing behavior. As part of this effort, a mechanism to substitute strings in a single HTTP response is added. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
Brandon Williams
7 years ago
committed by
Junio C Hamano
4 changed files with 99 additions and 0 deletions
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh |
||||
|
||||
# If "one-time-sed" exists in $HTTPD_ROOT_PATH, run sed on the HTTP response, |
||||
# using the contents of "one-time-sed" as the sed command to be run. If the |
||||
# response was modified as a result, delete "one-time-sed" so that subsequent |
||||
# HTTP responses are no longer modified. |
||||
# |
||||
# This can be used to simulate the effects of the repository changing in |
||||
# between HTTP request-response pairs. |
||||
if [ -e one-time-sed ]; then |
||||
"$GIT_EXEC_PATH/git-http-backend" >out |
||||
sed "$(cat one-time-sed)" <out >out_modified |
||||
|
||||
if diff out out_modified >/dev/null; then |
||||
cat out |
||||
else |
||||
cat out_modified |
||||
rm one-time-sed |
||||
fi |
||||
else |
||||
"$GIT_EXEC_PATH/git-http-backend" |
||||
fi |
Loading…
Reference in new issue