gitリポジトリのurlを貼り付けるだけでアプリケーションのビルドを実行するアプリ。 macOS用
修订版 | 9cc2b5bf960d235952a5cf45440f355d499c52cd (tree) |
---|---|
时间 | 2018-05-25 23:27:58 |
作者 | masakih <masakih@user...> |
Commiter | masakih |
chatchで分岐するようにした
@@ -47,23 +47,20 @@ final class Git { | ||
47 | 47 | |
48 | 48 | return |
49 | 49 | |
50 | - } catch { | |
51 | - | |
52 | - guard let e = error as? GitError else { | |
53 | - | |
54 | - completeHandler?(GitError.other("Unknown Error: \(error)")) | |
55 | - return | |
56 | - } | |
50 | + } catch let error as GitError { | |
57 | 51 | |
58 | - switch e { | |
52 | + if case let .gitError(stat, _) = error, stat == 128 { | |
59 | 53 | |
60 | - case let .gitError(stat, _) where stat == 128: | |
61 | 54 | tryPull(completeHandler: completeHandler) |
62 | 55 | |
63 | - default: | |
64 | - completeHandler?(e) | |
56 | + } else { | |
57 | + | |
58 | + completeHandler?(error) | |
65 | 59 | } |
66 | 60 | |
61 | + } catch { | |
62 | + | |
63 | + completeHandler?(GitError.other("Unknown Error: \(error)")) | |
67 | 64 | } |
68 | 65 | |
69 | 66 | } |
@@ -157,14 +154,13 @@ final class Git { | ||
157 | 154 | |
158 | 155 | completeHandler?(GitError.none) |
159 | 156 | |
157 | + } catch let error as GitError { | |
158 | + | |
159 | + completeHandler?(error) | |
160 | + | |
160 | 161 | } catch { |
161 | 162 | |
162 | - switch error { | |
163 | - | |
164 | - case let e as GitError: completeHandler?(e) | |
165 | - | |
166 | - default: completeHandler?(GitError.other("Unknown Error: \(error)")) | |
167 | - } | |
163 | + completeHandler?(GitError.other("Unknown Error: \(error)")) | |
168 | 164 | } |
169 | 165 | } |
170 | 166 |