-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
agit flow add refs/for-review/<pull index> support #31245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: a1012112796 <1012112796@qq.com>
Can you give some official documentation links for this new refs? |
services/agit/agit.go
Outdated
@@ -36,6 +36,75 @@ func ProcReceive(ctx context.Context, repo *repo_model.Repository, gitRepo *git. | |||
return nil, fmt.Errorf("failed to get user. Error: %w", err) | |||
} | |||
|
|||
updateExistPull := func(pr *issues_model.PullRequest, i int) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using a normal function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: a1012112796 <1012112796@qq.com>
if author not enabled
|
@@ -238,7 +238,8 @@ func runServ(c *cli.Context) error { | |||
if git.DefaultFeatures().SupportProcReceive { | |||
// for AGit Flow | |||
if cmd == "ssh_info" { | |||
fmt.Print(`{"type":"gitea","version":1}`) | |||
data := private.GetSSHInfo(ctx) | |||
fmt.Print(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Print(data) | |
fmt.Println(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it should use c *cli.Context
stdout, to make it testable.
@@ -104,6 +105,12 @@ func (ref RefName) IsFor() bool { | |||
return strings.HasPrefix(string(ref), ForPrefix) | |||
} | |||
|
|||
var forReviewPattern = regexp.MustCompile(ForReviewPrefix + `[1-9][0-9]*`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you need to ensure that the pull index is an integer greater than 0. ^[1-9]\d*$
As title, follow #14295
it can be used by author to update pull by pull index
and also can be used by mainter if the
Allow edits by maintainers
option was enabled.Documentation ref: https://git-repo.info/en/2020/03/agit-flow-git-repo/