aboutsummaryrefslogtreecommitdiffstats
path: root/config/refspec.go
diff options
context:
space:
mode:
Diffstat (limited to 'config/refspec.go')
-rw-r--r--config/refspec.go14
1 files changed, 3 insertions, 11 deletions
diff --git a/config/refspec.go b/config/refspec.go
index 7e4106a..af7e732 100644
--- a/config/refspec.go
+++ b/config/refspec.go
@@ -51,20 +51,12 @@ func (s RefSpec) Validate() error {
// IsForceUpdate returns if update is allowed in non fast-forward merges.
func (s RefSpec) IsForceUpdate() bool {
- if s[0] == refSpecForce[0] {
- return true
- }
-
- return false
+ return s[0] == refSpecForce[0]
}
// IsDelete returns true if the refspec indicates a delete (empty src).
func (s RefSpec) IsDelete() bool {
- if s[0] == refSpecSeparator[0] {
- return true
- }
-
- return false
+ return s[0] == refSpecSeparator[0]
}
// Src return the src side.
@@ -87,7 +79,7 @@ func (s RefSpec) Match(n plumbing.ReferenceName) bool {
// IsWildcard returns true if the RefSpec contains a wildcard.
func (s RefSpec) IsWildcard() bool {
- return strings.Index(string(s), refSpecWildcard) != -1
+ return strings.Contains(string(s), refSpecWildcard)
}
func (s RefSpec) matchExact(n plumbing.ReferenceName) bool {