feat: support for push --force-if-includes

This commit is contained in:
Ryooooooga 2022-12-27 00:23:39 +09:00
parent cd9111837e
commit e00f248cf7
No known key found for this signature in database
GPG key ID: 07CF200DFCC20C25
3 changed files with 42 additions and 2 deletions

View file

@ -29,7 +29,11 @@ func (self *SyncCommands) PushCmdObj(opts PushOpts) (oscommands.ICmdObj, error)
cmdStr := "git push"
if opts.Force {
cmdStr += " --force-with-lease"
if self.version.IsOlderThan(2, 30, 0) {
cmdStr += " --force-with-lease"
} else {
cmdStr += " --force-with-lease --force-if-includes"
}
}
if opts.SetUpstream {