I am trying to import a azure devops repo to a new repo within the same project. The following code just returns “Bad Request” and no other information.
public async Task ImportGenericRepository(GitRepository destinationRepository, GitRepository genericRepository, Guid serviceEndpointId)
{
var importRequest = new GitImportRequest
{
Repository = destinationRepository,
Parameters = new GitImportRequestParameters
{
GitSource = new GitImportGitSource
{
Url = genericRepository.RemoteUrl,
Overwrite = false
},
DeleteServiceEndpointAfterImportIsDone = true,
TfvcSource = null,
ServiceEndpointId = serviceEndpointId
},
};
try
{
await _connection.GitHttpClient.CreateImportRequestAsync(importRequest, _projectId, destinationRepository.Id);
}
catch (Exception ex)
{
throw;
}
}
I tried doing this directly with the HttpClient, I got the same error.