diff options
author | Ori Rawlings <orirawlings@gmail.com> | 2018-03-14 18:27:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-14 18:27:36 -0500 |
commit | a39fae69325f5a1faf8fe1b512124f3b77e8612d (patch) | |
tree | 37b8a887a981adca776a1d899afb2cf01b759191 /config/refspec.go | |
parent | 71e37414308043c18b9263ea8b18f296345b3e54 (diff) | |
parent | 87b70781ab9ff69811999396d76ca7dfdf6de24b (diff) | |
download | go-git-a39fae69325f5a1faf8fe1b512124f3b77e8612d.tar.gz |
Merge pull request #783 from maguro/refspec-src
Fix RefSpec.Src()
Diffstat (limited to 'config/refspec.go')
-rw-r--r-- | config/refspec.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/config/refspec.go b/config/refspec.go index af7e732..c9b9d52 100644 --- a/config/refspec.go +++ b/config/refspec.go @@ -62,7 +62,13 @@ func (s RefSpec) IsDelete() bool { // Src return the src side. func (s RefSpec) Src() string { spec := string(s) - start := strings.Index(spec, refSpecForce) + 1 + + var start int + if s.IsForceUpdate() { + start = 1 + } else { + start = 0 + } end := strings.Index(spec, refSpecSeparator) return spec[start:end] |