Skip to content

Commit

Permalink
Merge branch '50-bitbucket-workspace'
Browse files Browse the repository at this point in the history
  • Loading branch information
christianspecht committed May 6, 2020
2 parents 64d2863 + 6334683 commit 631fbf9
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 54 deletions.
32 changes: 1 addition & 31 deletions src/ScmBackup/Hosters/Bitbucket/BitbucketApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,7 @@ public List<HosterRepository> GetRepositoryList(ConfigSource source)
request.AddBasicAuthHeader(source.AuthName, source.Password);
}

string url = string.Empty;
string apiUsername = null;

// Issue #32: from Apr 29 2019, usernames (not team names) must be replaced by UUIDs
if (source.Type.ToLower() == "user")
{
url = "/2.0/workspaces/" + source.Name;

var result = request.Execute(url).Result;

if (result.IsSuccessStatusCode)
{
var apiResponse = JsonConvert.DeserializeObject<BitbucketApiUserResponse>(result.Content);
if (apiResponse != null)
{
apiUsername = Uri.EscapeUriString(apiResponse.uuid);
}
}

if (string.IsNullOrWhiteSpace(apiUsername))
{
throw new InvalidOperationException(string.Format(Resource.ApiBitbucketCantGetUuid, source.Name));
}
}
else
{
apiUsername = source.Name;
}


url = "/2.0/repositories/" + apiUsername;
string url = "/2.0/repositories/" + source.Name;

while (url != null)
{
Expand Down
11 changes: 0 additions & 11 deletions src/ScmBackup/Hosters/Bitbucket/BitbucketApiUserResponse.cs

This file was deleted.

9 changes: 0 additions & 9 deletions src/ScmBackup/Resource.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/ScmBackup/Resource.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@
<data name="ApiAuthenticationFailed" xml:space="preserve">
<value>Authentication failed for {0}</value>
</data>
<data name="ApiBitbucketCantGetUuid" xml:space="preserve">
<value>Unable to get the UUID for username {0} from the Bitbucket API</value>
</data>
<data name="ApiGettingRepos" xml:space="preserve">
<value>Getting repositories for source '{0}' from hoster '{1}'</value>
</data>
Expand Down

0 comments on commit 631fbf9

Please sign in to comment.