File tests/git_big_push.php changed (mode: 100644) (index 3529ec5..09dc61e) |
... |
... |
putenv('git_username=' . $rg_ui['username']); |
34 |
34 |
putenv('git_password=' . $rg_ui['pass']); |
putenv('git_password=' . $rg_ui['pass']); |
35 |
35 |
putenv('GIT_ASKPASS=' . dirname(__FILE__) . '/ask_pass'); |
putenv('GIT_ASKPASS=' . dirname(__FILE__) . '/ask_pass'); |
36 |
36 |
|
|
|
37 |
|
$remote = escapeshellarg($repo['clone_url_http']); |
|
38 |
|
|
|
39 |
|
|
|
40 |
|
rg_log(''); |
|
41 |
|
rg_log_enter('Testing push with a lot of small objects...'); |
|
42 |
|
$r = rg_exec('mkdir -p temp_repos && cd temp_repos' |
|
43 |
|
. ' && rm -rf git_small_obj && mkdir git_small_obj && cd git_small_obj' |
|
44 |
|
. ' && export GIT_CURL_VERBOSE=1 GIT_TRACE=1 GIT_TRACE_PACKET=1' |
|
45 |
|
. ' && git init' |
|
46 |
|
. ' && git remote add origin ' . $remote |
|
47 |
|
. ' && (for i in `seq 0 500`; do' |
|
48 |
|
. ' dd if=/dev/urandom of=a-${i} bs=10000 count=1' |
|
49 |
|
. ' && git add a-${i}' |
|
50 |
|
. ' && git commit -m "aaa-${i}";' |
|
51 |
|
. ' done)' |
|
52 |
|
. ' && git push --force origin master', |
|
53 |
|
'', FALSE, FALSE); |
|
54 |
|
if ($r['ok'] != 1) { |
|
55 |
|
rg_log_ml('Could not push lots of small files: ' . $r['errmsg'] . '!'); |
|
56 |
|
exit(1); |
|
57 |
|
} |
|
58 |
|
rg_log_exit(); |
|
59 |
|
//system('rm -rf temp_repos/git_small_obj'); |
|
60 |
|
|
37 |
61 |
|
|
38 |
62 |
rg_log(''); |
rg_log(''); |
39 |
63 |
rg_log_enter('Testing push with a big file...'); |
rg_log_enter('Testing push with a big file...'); |
40 |
|
$remote = escapeshellarg($repo['clone_url_http']); |
|
41 |
64 |
$r = rg_exec('mkdir -p temp_repos && cd temp_repos' |
$r = rg_exec('mkdir -p temp_repos && cd temp_repos' |
42 |
65 |
. ' && rm -rf git_big_push && mkdir git_big_push && cd git_big_push' |
. ' && rm -rf git_big_push && mkdir git_big_push && cd git_big_push' |
43 |
66 |
. ' && git init' |
. ' && git init' |
|
... |
... |
if ($r['ok'] != 1) { |
53 |
76 |
} |
} |
54 |
77 |
$r = rg_exec('cd temp_repos/git_big_push' |
$r = rg_exec('cd temp_repos/git_big_push' |
55 |
78 |
. ' && export GIT_CURL_VERBOSE=1 GIT_TRACE=1 GIT_TRACE_PACKET=1' |
. ' && export GIT_CURL_VERBOSE=1 GIT_TRACE=1 GIT_TRACE_PACKET=1' |
56 |
|
. ' && git push origin master', |
|
|
79 |
|
. ' && git push --force origin master', |
57 |
80 |
'', FALSE, FALSE); |
'', FALSE, FALSE); |
58 |
81 |
if ($r['ok'] != 1) { |
if ($r['ok'] != 1) { |
59 |
82 |
if (!strstr($r['errmsg'], 'git config http.postBuffer')) { |
if (!strstr($r['errmsg'], 'git config http.postBuffer')) { |