From 2e614444516d735dc2cad5b63a0d0edf364cb26d Mon Sep 17 00:00:00 2001 From: Jamie Cansdale Date: Mon, 14 Jan 2019 12:31:22 +0000 Subject: [PATCH] Only auto-fill clone URL for blob and repo links --- src/GitHub.App/Services/DialogService.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/GitHub.App/Services/DialogService.cs b/src/GitHub.App/Services/DialogService.cs index e3f2c40f95..1bf666c7d2 100644 --- a/src/GitHub.App/Services/DialogService.cs +++ b/src/GitHub.App/Services/DialogService.cs @@ -2,6 +2,7 @@ using System.ComponentModel.Composition; using System.Threading.Tasks; using GitHub.Api; +using GitHub.Exports; using GitHub.Extensions; using GitHub.Factories; using GitHub.Models; @@ -38,7 +39,13 @@ public async Task ShowCloneDialog(IConnection connection, str if (string.IsNullOrEmpty(url)) { var clipboardContext = gitHubContextService.FindContextFromClipboard(); - url = clipboardContext?.Url; + switch (clipboardContext?.LinkType) + { + case LinkType.Blob: + case LinkType.Repository: + url = clipboardContext?.Url; + break; + } } var viewModel = factory.CreateViewModel();