-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Branches not at ref commit ID should not be listed as Merged #9614
Merged
Merged
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
93364b9
Don't list as merged branches not at mergecommitid
zeripath 4af6395
Need to use the refs/pull/x/head
zeripath 84decfe
Slight efficiency improvement
zeripath 3db7335
Update routers/repo/branch.go
zeripath 6f8d95e
Slight efficiency improvement
zeripath ba13b0f
Also fix #9158
zeripath a9d65b8
Further slight efficiency improvement
zeripath 4c40b8e
Add refs/pull/3/head to fix the integration test
zeripath d3a5b4b
Alternative head to push
zeripath 6ebbe30
Update routers/repo/branch.go
zeripath 705420a
Allow HeadRepo to be nil
zeripath d6d2f87
More efficiency - in branch view we know that all of these PRs have t…
zeripath cf502ac
Further improvement - we already have the head commit - so use it
zeripath d76f586
Fix nil pointer dereference
zeripath 13175c0
Merge branch 'master' into fix-9201
zeripath c440e52
Merge branch 'master' into fix-9201
zeripath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+17 Bytes
...gitea-repositories-meta/user2/repo1.git/objects/00/750edc07d6415dcc07ae0351e9397b0222b7ba
Binary file not shown.
Binary file added
BIN
+840 Bytes
...gitea-repositories-meta/user2/repo1.git/objects/4a/357436d925b5c974181ff12a994538ddc5a269
Binary file not shown.
Binary file added
BIN
+78 Bytes
...gitea-repositories-meta/user2/repo1.git/objects/dc/7a8ba127fee870dd683310ce660dfe59333a1b
Binary file not shown.
1 change: 1 addition & 0 deletions
1
integrations/gitea-repositories-meta/user2/repo1.git/refs/pull/3/head
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
4a357436d925b5c974181ff12a994538ddc5a269 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 this is an edge case and is covered elsewhere but, perhaps if we've got
ErrReferenceNotFound
we should hide thenew PR
button as well?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.
Is this referring to when I thought it was possible to not get the head branch commit id? We actually always know that's there because otherwise there would have been a ServerError at line 200. So that can't happen and I've optimised that check away.
OR
is this referring to if we can't find the PR pulls head in the base repo?
I'm not sure what to do in that case. If I try to enforce that the pulls head is actually there I suspect that will break a lot of integration tests - as our fixtures do not necessarily match the ground truth. I also expect that there is a race between the db and the presence of the pull head. (We should check what happens here - the index is needed to create the pull head - so that means that the db has to have a pull request committed before we can push to the pull head.)
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.
I meant that
MergeMovedOn
, which has a restrictive meaning, is only set to true if both heads are found, but the restriction (which is to hide theNew PR
button) still should apply if any of the heads is missing (ErrReferenceNotFound
). Maybe when any of the heads is missing it should also be set to true, but then its name should be changed because it will no longer reflect the exact scenario.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.
I don't understand.
Perhaps some of what you're discussing is already fixed within the logic of the template?
If you don't have a PR already then merge moved on is of no consequence.
The head branch we already know exists because it's the branch we've provided.
If the base branch does not exist - that's a server error - although this won't show that. You shouldn't be able to delete a branch with PRs against it - (although I haven't checked that.) If the git pull head isn't there well... that's technically a server error but I think there could be a race between between a pull request being made and the ref being updated so I think we should allow it.