From 7dd4ca514ee4576983053b48c056be50814805b6 Mon Sep 17 00:00:00 2001 From: Vincent Esche Date: Mon, 27 Apr 2020 20:48:58 +0200 Subject: [PATCH] Fixed error names --- Sources/Pathspec/GitIgnoreSpec.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Pathspec/GitIgnoreSpec.swift b/Sources/Pathspec/GitIgnoreSpec.swift index 6b25257..97937a3 100644 --- a/Sources/Pathspec/GitIgnoreSpec.swift +++ b/Sources/Pathspec/GitIgnoreSpec.swift @@ -10,8 +10,8 @@ import Foundation struct GitIgnoreSpec: Spec { enum Error: Swift.Error { case emptyPattern - case containsPoundPrefix - case containsTrippleStar + case commented + case invalid case emptyRoot } @@ -24,9 +24,9 @@ struct GitIgnoreSpec: Spec { self.pattern = pattern guard !pattern.isEmpty else { throw Error.emptyPattern } - guard !pattern.hasPrefix("#") else { throw Error.containsPoundPrefix } - guard !pattern.contains("***") else { throw Error.containsTrippleStar } - guard pattern != "/" else { throw Error.emptyPattern } + guard !pattern.hasPrefix("#") else { throw Error.commented } + guard !pattern.contains("***") else { throw Error.invalid } + guard pattern != "/" else { throw Error.emptyRoot } var pattern = pattern if pattern.hasPrefix("!") {