diff --git a/src/de/uni_passau/fim/seibt/gitwrapper/repo/GitWrapper.java b/src/de/uni_passau/fim/seibt/gitwrapper/repo/GitWrapper.java index 12061e98b52a9c26947e869e8450533dd57d4c16..e920a97aa67b2e79127a6d8833e4f8328c739508 100644 --- a/src/de/uni_passau/fim/seibt/gitwrapper/repo/GitWrapper.java +++ b/src/de/uni_passau/fim/seibt/gitwrapper/repo/GitWrapper.java @@ -132,7 +132,16 @@ public class GitWrapper extends ToolWrapper { return Optional.empty(); } - return Optional.of(new Repository(this, "", directory)); + Optional<ExecRes> result = exec(directory, "config", "--get", "remote.origin.url"); + Optional<String> url = result.map(res -> { + String repoUrl = null; + if (this.failed(res) || (repoUrl = res.stdOut.trim()).isEmpty()) { + // there was no remote url + repoUrl = directory.getAbsolutePath(); + } + return repoUrl; + }); + return Optional.of(new Repository(this, url.orElse(""), directory)); } /**