diff options
author | John Cai <jcai@gitlab.com> | 2021-11-03 14:04:06 -0400 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2021-11-03 15:13:09 -0400 |
commit | 589a41ceedfa89e1ff334a969d1beb28cb731de9 (patch) | |
tree | f568b7430586771a49bb1e714bee432ed9596deb /remote.go | |
parent | 3211a7a12a0ec2922d257fb14f09c6ecfb0b7c77 (diff) | |
download | go-git-589a41ceedfa89e1ff334a969d1beb28cb731de9.tar.gz |
Add Atomic to push options
push --atomic allows a push to succeed or fail atomically. If one ref
fails, the whole push fails. This commit allows the user to set Atomic
as an option for a push.
Diffstat (limited to 'remote.go')
-rw-r--r-- | remote.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -326,6 +326,10 @@ func (r *Remote) newReferenceUpdateRequest( } } + if o.Atomic && ar.Capabilities.Supports(capability.Atomic) { + _ = req.Capabilities.Set(capability.Atomic) + } + if err := r.addReferencesToUpdate(o.RefSpecs, localRefs, remoteRefs, req, o.Prune); err != nil { return nil, err } |