• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 29991593234

23 Jul 2026 08:34AM UTC coverage: 72.516% (+0.02%) from 72.496%
29991593234

Pull #2198

github

web-flow
Merge a5f9cf6c0 into 5b6cc3011
Pull Request #2198: Feature/2168 repository remote feature

4985 of 7600 branches covered (65.59%)

Branch coverage included in aggregate %.

12846 of 16989 relevant lines covered (75.61%)

3.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

74.19
cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryConfig.java
1
package com.devonfw.tools.ide.git.repository;
2

3
import java.nio.file.Path;
4
import java.util.List;
5
import java.util.Properties;
6
import java.util.Set;
7

8
import com.devonfw.tools.ide.context.IdeContext;
9
import com.devonfw.tools.ide.git.GitUrl;
10

11
/**
12
 * Represents the configuration of a repository to be used by the {@link RepositoryCommandlet}.
13
 *
14
 * @param id Identifier derived from the filename without extension.
15
 * @param path Path into which the project is cloned. This path is relative to the workspace.
16
 * @param workingSets The working sets associated with the repository (for Eclipse import).
17
 * @param workspaces Workspaces to use for checkout and import. Supports comma-separated values. Default is main.
18
 * @param gitUrl Git URL to use for cloning the project.
19
 * @param gitBranch Git branch to checkout. Git default branch is default.
20
 * @param buildPath The build path for the repository.
21
 * @param buildCmd The command to invoke to build the repository after clone or pull. If omitted no build is triggered.
22
 * @param imports list of IDEs where the repository will be imported to.
23
 * @param remotes list of additional git remotes to add to the repository after cloning.
24
 * @param active {@code true} to setup the repository during setup, {@code false} to skip.
25
 */
26
public record RepositoryConfig(
27
    String id,
28
    String path,
29
    String workingSets,
30
    List<String> workspaces,
31
    String gitUrl,
32
    String gitBranch,
33
    String buildPath,
34
    String buildCmd,
35
    Set<String> imports,
36
    List<RepositoryLink> links,
37
    List<RepositoryRemote> remotes,
38
    boolean active) {
39

40
  /** Wildcard to match all workspaces. */
41
  public static final String WORKSPACE_NAME_ALL = "*";
42

43
  public RepositoryConfig {
38✔
44
    if (workspaces == null || workspaces.isEmpty()) {
5!
45
      throw new IllegalArgumentException("workspaces cannot be empty");
×
46
    }
47
  }
1✔
48

49
  /**
50
   * @return the {@link GitUrl} from {@link #gitUrl()} and {@link #gitBranch()}.
51
   */
52
  public GitUrl asGitUrl() {
53

54
    if (this.gitUrl == null) {
3!
55
      return null;
×
56
    }
57
    return new GitUrl(this.gitUrl, this.gitBranch);
8✔
58
  }
59

60
  /**
61
   * @param filePath the {@link Path} to the {@link Properties} to load.
62
   * @param context the {@link IdeContext}.
63
   * @return the parsed {@link RepositoryConfig}.
64
   */
65
  public static RepositoryConfig loadProperties(Path filePath, IdeContext context) {
66

67
    RepositoryProperties properties = new RepositoryProperties(filePath, context);
6✔
68
    String id = properties.getId();
3✔
69
    RepositoryConfig config = new RepositoryConfig(id, properties.getPath(), properties.getWorkingSets(), properties.getWorkspaces(), properties.getGitUrl(),
12✔
70
        properties.getGitBranch(), properties.getBuildPath(), properties.getBuildCmd(), properties.getImports(), properties.getLinks(), properties.getRemotes(),
12✔
71
        properties.isActive());
3✔
72
    if (properties.isInvalid()) {
3✔
73
      return null;
2✔
74
    }
75
    return config;
2✔
76
  }
77

78
  public boolean isVirtualSettingsRepository() {
79
    return IdeContext.SETTINGS_REPOSITORY_KEYWORD.equals(this.id)
9!
80
        && (this.gitUrl == null || this.gitUrl.isBlank());
3!
81
  }
82
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc