forked from forgejo/forgejo
[FEAT] Allow non-explicit push options
- Currently the parsing of the push options require that `=` is present in the value, however we shouldn't be that strict and assume if that's not set the value is `true`. - This allow for more natural commands, so become `-o force-push=true` simply `-o force-push`. - Add unit test.
This commit is contained in:
parent
7d35a76ebf
commit
f5ad6d4be5
3 changed files with 24 additions and 7 deletions
|
@ -1025,7 +1025,7 @@ func doCreateAgitFlowPull(dstPath string, ctx *APITestContext, baseBranch, headB
|
|||
t.Run("Succeeds", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
_, _, gitErr := git.NewCommand(git.DefaultContext, "push", "origin", "-o", "force-push=true").AddDynamicArguments("HEAD:refs/for/master/" + headBranch + "-force-push").RunStdString(&git.RunOpts{Dir: dstPath})
|
||||
_, _, gitErr := git.NewCommand(git.DefaultContext, "push", "origin", "-o", "force-push").AddDynamicArguments("HEAD:refs/for/master/" + headBranch + "-force-push").RunStdString(&git.RunOpts{Dir: dstPath})
|
||||
assert.NoError(t, gitErr)
|
||||
|
||||
currentHeadCommitID, err := upstreamGitRepo.GetRefCommitID(pr.GetGitRefName())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue