Skip to content

Commit a657ec0

Browse files
committed
Fix error messages when detecting if InRule repo
1 parent c003e15 commit a657ec0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/Sknet.InRuleGitStorage/InRuleGitRepository.cs

+10-3
Original file line numberDiff line numberDiff line change
@@ -642,10 +642,17 @@ public static string Init(string path)
642642
nameof(path));
643643
}
644644

645+
if (Repository.IsValid(path))
646+
{
647+
throw new ArgumentException(
648+
"Specified path already contains an existing Git repository; cannot initialize a new InRule Git repository.",
649+
nameof(path));
650+
}
651+
645652
if (IsValid(path))
646653
{
647654
throw new ArgumentException(
648-
"Specified path already contains an existing git repository; cannot initialize a new Git repository.",
655+
"Specified path already contains an existing InRule Git repository; cannot initialize a new InRule Git repository.",
649656
nameof(path));
650657
}
651658

@@ -698,7 +705,7 @@ public static InRuleGitRepository Open(string path)
698705
if (!IsValid(path))
699706
{
700707
throw new ArgumentException(
701-
"Specified path is not a valid Git repository.",
708+
"Specified path is not a valid InRule Git repository.",
702709
nameof(path));
703710
}
704711

@@ -737,7 +744,7 @@ private static void SetFolderIcon(string path)
737744
if (path == null) throw new ArgumentNullException(nameof(path));
738745
if (string.IsNullOrWhiteSpace(path)) throw new ArgumentException("Specified path cannot be null or whitespace.", nameof(path));
739746

740-
File.SetAttributes(path, File.GetAttributes(path) /*| FileAttributes.System*/ | FileAttributes.ReadOnly);
747+
File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.ReadOnly);
741748

742749
var logoPath = Path.Combine(path, "logo.ico");
743750
using (Stream input = typeof(InRuleGitRepository).Assembly.GetManifestResourceStream("Sknet.InRuleGitStorage.logo.ico"))

0 commit comments

Comments
 (0)