aboutsummaryrefslogtreecommitdiffstats
path: root/config/refspec.go
diff options
context:
space:
mode:
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)