Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I get stash http clone url now?

Justin Shapiro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 2, 2014
navBuilder.repo(repository).clone("git")
.buildAbsoluteWithoutUsername();

Now that this code is deprecated, how should I get the url without the username?

Seems this is the suggested route

repositoryService.getCloneLinks(new RepositoryCloneLinksRequest.Builder().repository(repository)
                                .protocol("http").build());

but it takes user context into account

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
mstudman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 3, 2014

So that seems to be an oversight on my part when I deprecated the original method and added the new one.

For the moment it is safe to use the original method chain until 2.12 but probably not beyond that (when it may be removed).

In the mean time I will fix this by adding a way for you to disable username in the URL (probably on the request object). This should be available in 2.12.

You can track it here: https://jira.atlassian.com/browse/STASH-4450

mstudman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 20, 2014

An update on this: I've added a way in 2.12 to supply the user (or no user) in addition to the default behaviour which is to the currently authenticated user. So the code you would write is:

repositoryService.getCloneLinks(new RepositoryCloneLinksRequest.Builder().repository(repository).user(null).protocol("http").build());

TAGS
AUG Leaders

Atlassian Community Events