ben-gibson/GitLink

IllegalArgumentException: Invalid host '' for the repo cloned from the filesystem

gavvvr opened this issue · 2 comments

Hi. If I have a copy of repo cloned from local filesystem like this:

git clone ~/Documents/some-bare-repo.git regular-clone

the plugin will explode with "IllegalArgumentException: Invalid host" on attempt to open such repo in Intellij.

The stacktrace
java.lang.IllegalArgumentException: Invalid host ''
	at uk.co.ben_gibson.url.Host.<init>(Host.kt:7)
	at uk.co.ben_gibson.url.Host.<init>(Host.kt)
	at uk.co.ben_gibson.url.Host$Companion.invoke(Host.kt:11)
	at uk.co.ben_gibson.url.URL$Companion.fromString(URL.kt:26)
	at uk.co.ben_gibson.git.link.git.RemoteExtensionsKt.getHttpUrl(RemoteExtensions.kt:41)
	at uk.co.ben_gibson.git.link.git.RemoteExtensionsKt.getDomain(RemoteExtensions.kt:14)
	at uk.co.ben_gibson.git.link.platform.PlatformDetector.getPlatformForRepository(PlatformDetector.kt:39)
	at uk.co.ben_gibson.git.link.platform.PlatformDetector.access$getPlatformForRepository(PlatformDetector.kt:17)
	at uk.co.ben_gibson.git.link.platform.PlatformDetector$detect$1.invoke(PlatformDetector.kt:26)
	at uk.co.ben_gibson.git.link.platform.PlatformDetector$detect$1.invoke(PlatformDetector.kt:26)
	at uk.co.ben_gibson.git.link.platform.PlatformDetector.getRepositoryForFile$lambda-2(PlatformDetector.kt:58)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:646)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:625)
	at com.intellij.util.messages.impl.MessageBusImplKt.deliverMessage(MessageBusImpl.kt:399)
	at com.intellij.util.messages.impl.MessageBusImplKt.pumpWaiting(MessageBusImpl.kt:378)
	at com.intellij.util.messages.impl.MessageBusImplKt.access$pumpWaiting(MessageBusImpl.kt:1)
	at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:437)
	at jdk.proxy2/jdk.proxy2.$Proxy129.mappingChanged(Unknown Source)
	at com.intellij.dvcs.repo.VcsRepositoryManager.checkAndUpdateRepositoriesCollection(VcsRepositoryManager.java:350)
	at com.intellij.dvcs.repo.VcsRepositoryManager.lambda$scheduleUpdate$1(VcsRepositoryManager.java:124)
	at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:241)
	at com.intellij.util.Alarm$Request.runSafely(Alarm.java:388)
	at com.intellij.util.Alarm$Request.run(Alarm.java:377)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:223)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:241)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:31)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:214)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:212)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:203)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)

I think this should now be resolved in the latest version 4.2.5.

Looks like it is 👍
Just tried and I do not observe an exception