summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike JS. Choi <mkchoi212@icloud.com>2018-01-05 22:41:44 -0600
committerMike JS. Choi <mkchoi212@icloud.com>2018-01-05 22:41:44 -0600
commit3114cf93bba24f1c269c5c58da53e902de9b5245 (patch)
tree0815e6e08d1060fc692204e246141aaa5d59be16
parentec22b89fcfc22e7bc77628597f4ce833a9a7d0ff (diff)
Add additional edge case for when there are no conflicts
-rw-r--r--conflict/parse.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/conflict/parse.go b/conflict/parse.go
index 5194e37..6bf4e96 100644
--- a/conflict/parse.go
+++ b/conflict/parse.go
@@ -175,6 +175,11 @@ func Find() (err error) {
}
}
+ Count = len(All)
+ if Count == 0 {
+ return NewErrNoConflict("No conflicts detected 🎉")
+ }
+
FileLines = make(map[string][]string)
for i := range All {
if err = All[i].ExtractLines(); err != nil {
@@ -185,6 +190,5 @@ func Find() (err error) {
}
}
- Count = len(All)
return nil
}