diff options
author | Christian Muehlhaeuser <muesli@gmail.com> | 2019-07-21 06:15:34 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2019-07-29 17:34:12 +0200 |
commit | bfe45eef34bfad73dc9c5255ac8f06ae19501554 (patch) | |
tree | 7693dfd33a52bbe1cb724e949a219afa7f0bda5b | |
parent | 28675baffe8f5590401a96c5a0cb4fe0fc6f4da7 (diff) | |
download | go-git-bfe45eef34bfad73dc9c5255ac8f06ae19501554.tar.gz |
plumbing/format: simplify code
Just a bit easier to read, in my opinion.
Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com>
(cherry picked from commit 91d314ce8f13eff06fd4af8b869cee5a3e2ab014)
-rw-r--r-- | plumbing/format/diff/unified_encoder.go | 2 | ||||
-rw-r--r-- | plumbing/format/gitattributes/pattern.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/plumbing/format/diff/unified_encoder.go b/plumbing/format/diff/unified_encoder.go index 8bd6d8a..169242d 100644 --- a/plumbing/format/diff/unified_encoder.go +++ b/plumbing/format/diff/unified_encoder.go @@ -94,7 +94,7 @@ func (e *UnifiedEncoder) printMessage(message string) { isEmpty := message == "" hasSuffix := strings.HasSuffix(message, "\n") if !isEmpty && !hasSuffix { - message = message + "\n" + message += "\n" } e.buf.WriteString(message) diff --git a/plumbing/format/gitattributes/pattern.go b/plumbing/format/gitattributes/pattern.go index c5ca0c7..d961aba 100644 --- a/plumbing/format/gitattributes/pattern.go +++ b/plumbing/format/gitattributes/pattern.go @@ -66,7 +66,7 @@ func (p *pattern) Match(path []string) bool { doublestar = true } - switch true { + switch { case strings.Contains(pattern[0], "**"): return false |