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

Commit 473373c

Browse files
committed
Update error message for non-empty directory.
1 parent c82ca09 commit 473373c

17 files changed

+40
-38
lines changed

src/GitHub.App/ViewModels/Dialog/Clone/RepositoryCloneViewModel.cs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -242,21 +242,23 @@ string ValidatePathWarning(RepositoryModel repositoryModel, string path)
242242
{
243243
using (var repository = gitService.GetRepository(path))
244244
{
245-
if (repository == null)
245+
if (repository != null)
246246
{
247-
return Resources.CantFindARepositoryAtLocalPath;
247+
var localUrl = gitService.GetRemoteUri(repository)?.ToRepositoryUrl();
248+
if (localUrl == null)
249+
{
250+
return Resources.LocalRepositoryDoesntHaveARemoteOrigin;
251+
}
252+
253+
var targetUrl = repositoryModel.CloneUrl?.ToRepositoryUrl();
254+
if (localUrl != targetUrl)
255+
{
256+
return string.Format(CultureInfo.CurrentCulture, Resources.LocalRepositoryHasARemoteOf, localUrl);
257+
}
248258
}
249-
250-
var localUrl = gitService.GetRemoteUri(repository)?.ToRepositoryUrl();
251-
if (localUrl == null)
252-
{
253-
return Resources.LocalRepositoryDoesntHaveARemoteOrigin;
254-
}
255-
256-
var targetUrl = repositoryModel.CloneUrl?.ToRepositoryUrl();
257-
if (localUrl != targetUrl)
259+
else
258260
{
259-
return string.Format(CultureInfo.CurrentCulture, Resources.LocalRepositoryHasARemoteOf, localUrl);
261+
return Resources.DirectoryAtDestinationNotEmpty;
260262
}
261263

262264
return Resources.YouHaveAlreadyClonedToThisLocation;

src/GitHub.Resources/Resources.Designer.cs

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GitHub.Resources/Resources.cs-CZ.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ https://git-scm.com/download/win</value>
809809
<data name="NoResolveSameOwnerMessage" xml:space="preserve">
810810
<value>V aktuálním úložišti se nepodařilo najít cílovou adresu URL. Zkuste to znovu po načtení změn.</value>
811811
</data>
812-
<data name="CantFindARepositoryAtLocalPath" xml:space="preserve">
812+
<data name="DirectoryAtDestinationNotEmpty" xml:space="preserve">
813813
<value>V tomto umístění je už adresář, ale neobsahuje úložiště.</value>
814814
</data>
815815
<data name="LocalRepositoryDoesntHaveARemoteOrigin" xml:space="preserve">

src/GitHub.Resources/Resources.de-DE.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ https://git-scm.com/download/win</value>
809809
<data name="NoResolveSameOwnerMessage" xml:space="preserve">
810810
<value>Die Ziel-URL wurde im aktuellen Repository nicht gefunden. Versuchen Sie es nach einem Abrufvorgang (fetch) noch einmal.</value>
811811
</data>
812-
<data name="CantFindARepositoryAtLocalPath" xml:space="preserve">
812+
<data name="DirectoryAtDestinationNotEmpty" xml:space="preserve">
813813
<value>An diesem Speicherort liegt bereits ein Verzeichnis vor, aber es enthält kein Repository.</value>
814814
</data>
815815
<data name="LocalRepositoryDoesntHaveARemoteOrigin" xml:space="preserve">

src/GitHub.Resources/Resources.es-ES.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ https://git-scm.com/download/win</value>
809809
<data name="NoResolveSameOwnerMessage" xml:space="preserve">
810810
<value>No se encontró la dirección URL de destino en el repositorio actual. Vuelva a intentarlo tras una recuperación de cambios.</value>
811811
</data>
812-
<data name="CantFindARepositoryAtLocalPath" xml:space="preserve">
812+
<data name="DirectoryAtDestinationNotEmpty" xml:space="preserve">
813813
<value>Ya hay un directorio en esta ubicación, pero no contiene un repositorio.</value>
814814
</data>
815815
<data name="LocalRepositoryDoesntHaveARemoteOrigin" xml:space="preserve">

src/GitHub.Resources/Resources.fr-FR.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ https://git-scm.com/download/win</value>
809809
<data name="NoResolveSameOwnerMessage" xml:space="preserve">
810810
<value>L'URL cible est introuvable dans le dépôt actuel. Réessayez après une récupération (fetch).</value>
811811
</data>
812-
<data name="CantFindARepositoryAtLocalPath" xml:space="preserve">
812+
<data name="DirectoryAtDestinationNotEmpty" xml:space="preserve">
813813
<value>Un répertoire est déjà présent à cet emplacement, mais il ne contient pas de dépôt.</value>
814814
</data>
815815
<data name="LocalRepositoryDoesntHaveARemoteOrigin" xml:space="preserve">

src/GitHub.Resources/Resources.it-IT.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ https://git-scm.com/download/win</value>
809809
<data name="NoResolveSameOwnerMessage" xml:space="preserve">
810810
<value>Non è stato trovato alcun URL di destinazione nel repository corrente. Riprovare dopo aver eseguito il comando fetch.</value>
811811
</data>
812-
<data name="CantFindARepositoryAtLocalPath" xml:space="preserve">
812+
<data name="DirectoryAtDestinationNotEmpty" xml:space="preserve">
813813
<value>In questo percorso esiste già una directory che però non contiene un repository.</value>
814814
</data>
815815
<data name="LocalRepositoryDoesntHaveARemoteOrigin" xml:space="preserve">

src/GitHub.Resources/Resources.ja-JP.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ https://git-scm.com/download/win</value>
809809
<data name="NoResolveSameOwnerMessage" xml:space="preserve">
810810
<value>現在のリポジトリにターゲット URL が見つかりませんでした。フェッチを実行した後、もう一度お試しください。</value>
811811
</data>
812-
<data name="CantFindARepositoryAtLocalPath" xml:space="preserve">
812+
<data name="DirectoryAtDestinationNotEmpty" xml:space="preserve">
813813
<value>この場所に既にディレクトリがありますが、リポジトリが含まれていません。</value>
814814
</data>
815815
<data name="LocalRepositoryDoesntHaveARemoteOrigin" xml:space="preserve">

src/GitHub.Resources/Resources.ko-KR.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ https://git-scm.com/download/win</value>
809809
<data name="NoResolveSameOwnerMessage" xml:space="preserve">
810810
<value>현재 리포지토리에서 대상 URL을 찾을 수 없습니다. 페치를 수행한 후 다시 시도하세요.</value>
811811
</data>
812-
<data name="CantFindARepositoryAtLocalPath" xml:space="preserve">
812+
<data name="DirectoryAtDestinationNotEmpty" xml:space="preserve">
813813
<value>이 위치에 이미 디렉터리가 있지만, 디렉터리에 리포지토리가 없습니다.</value>
814814
</data>
815815
<data name="LocalRepositoryDoesntHaveARemoteOrigin" xml:space="preserve">

src/GitHub.Resources/Resources.pl-PL.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ https://git-scm.com/download/win</value>
809809
<data name="NoResolveSameOwnerMessage" xml:space="preserve">
810810
<value>Nie można odnaleźć docelowego adresu URL w bieżącym repozytorium. Spróbuj ponownie po zakończeniu pobierania.</value>
811811
</data>
812-
<data name="CantFindARepositoryAtLocalPath" xml:space="preserve">
812+
<data name="DirectoryAtDestinationNotEmpty" xml:space="preserve">
813813
<value>W tej lokalizacji istnieje już katalog, ale nie zawiera on repozytorium.</value>
814814
</data>
815815
<data name="LocalRepositoryDoesntHaveARemoteOrigin" xml:space="preserve">

0 commit comments

Comments
 (0)