Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Only auto-fill clone URL for blob and repo links
Browse files Browse the repository at this point in the history
  • Loading branch information
jcansdale committed Jan 14, 2019
1 parent 2c22a36 commit 2e61444
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/GitHub.App/Services/DialogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -38,7 +39,13 @@ public async Task<CloneDialogResult> 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<IRepositoryCloneViewModel>();
Expand Down

0 comments on commit 2e61444

Please sign in to comment.