Skip to content
This repository was archived by the owner on Mar 28, 2026. It is now read-only.

Commit cb8a407

Browse files
WorkspaceAPIClient: Allows "main" to be used to refer to the main/default branch.
1 parent 1e6c2a3 commit cb8a407

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

structurizr-client/src/main/java/com/structurizr/api/WorkspaceApiClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
public class WorkspaceApiClient extends AbstractApiClient {
4040

4141
private static final Log log = LogFactory.getLog(WorkspaceApiClient.class);
42+
private static final String MAIN_BRANCH = "main";
4243

4344
private String user;
4445

@@ -234,7 +235,7 @@ public Workspace getWorkspace(long workspaceId) throws StructurizrClientExceptio
234235
log.info("Getting workspace with ID " + workspaceId);
235236

236237
HttpGet httpGet;
237-
if (StringUtils.isNullOrEmpty(branch)) {
238+
if (StringUtils.isNullOrEmpty(branch) || branch.equalsIgnoreCase(MAIN_BRANCH)) {
238239
httpGet = new HttpGet(url + WORKSPACE_PATH + "/" + workspaceId);
239240
} else {
240241
httpGet = new HttpGet(url + WORKSPACE_PATH + "/" + workspaceId + "/branch/" + branch);

0 commit comments

Comments
 (0)