aboutsummaryrefslogtreecommitdiffstats
path: root/config/refspec.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-12-08 14:24:12 +0100
committerGitHub <noreply@github.com>2016-12-08 14:24:12 +0100
commit3962b8d4dbb2d2d61e9282d73f8d3d0f2a222461 (patch)
tree30e660ad822abaf77c360a52f56e7e81ba250ad3 /config/refspec.go
parenta91727b6d5e6d8db17e960de6255bc848c78a076 (diff)
downloadgo-git-3962b8d4dbb2d2d61e9282d73f8d3d0f2a222461.tar.gz
config: support delete refspecs (IsDelete). (#166)
Diffstat (limited to 'config/refspec.go')
-rw-r--r--config/refspec.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/config/refspec.go b/config/refspec.go
index fd0aa3d..9451170 100644
--- a/config/refspec.go
+++ b/config/refspec.go
@@ -48,6 +48,15 @@ func (s RefSpec) IsForceUpdate() bool {
return false
}
+// 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
+}
+
// Src return the src side
func (s RefSpec) Src() string {
spec := string(s)