aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
authorChris Gavin <chris@chrisgavin.me>2020-08-28 10:32:28 +0100
committerChris Gavin <chris@chrisgavin.me>2020-08-28 10:35:37 +0100
commit711b703b572e07d3d0437eae4662419b5c392a6b (patch)
treec0eec2aae09993118c120fa04db57bf1bd1126f9 /remote.go
parent5bf939bc5c03b149e7ec80653bcaa901d05d0d44 (diff)
downloadgo-git-711b703b572e07d3d0437eae4662419b5c392a6b.tar.gz
git: remote, Fix deleting references when force pushing.
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/remote.go b/remote.go
index 39da24e..89b3051 100644
--- a/remote.go
+++ b/remote.go
@@ -126,7 +126,7 @@ func (r *Remote) PushContext(ctx context.Context, o *PushOptions) (err error) {
if o.Force {
for i := 0; i < len(o.RefSpecs); i++ {
rs := &o.RefSpecs[i]
- if !rs.IsForceUpdate() {
+ if !rs.IsForceUpdate() && !rs.IsDelete() {
o.RefSpecs[i] = config.RefSpec("+" + rs.String())
}
}