I'm try to add read permissions to forked repositories so that team members can access each others commits.
I have a powershell script that looks roughly like this:
param(
[Parameter(Mandatory=${true})][string]$gitUser = "jdoe",
[Parameter(Mandatory=${false})][string]$gitPrj = "DEMO"
)
$headers = @{}
$headers.Add('Accept','application/json')
$headers.Add('Authorization','Basic 123abc456def')
$repos = @("repo1","repo2","repo3","repo4","repo5")
foreach ($repo in $repos) {
$uri = "http://$gitHost/rest/api/1.0/projects/~$gitUser/repos/$repo/permissions/groups?permission=REPO_READ&name=R_STAS_$gitPrj_dev"
$response = Invoke-RestMethod -Uri $uri -Headers $headers -Method "POST"
}
This works nicely for the first two repos, but the third (and subsequent) API call fail with a timeout:
System.Net.WebException: The operation has timed out.
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
The order of the repositories doesn't matter so breaking the script up in chunks that does 2 repos and then calling all the two-repo scripts does in fact work.
Stash support is unable to help 
Has anybody tried something similar?
TIA
/anders