-
-
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
Fix loadOneBranch panic #29938
Fix loadOneBranch panic #29938
Conversation
7e58b60
to
9977d09
Compare
9977d09
to
d2938ed
Compare
@@ -283,7 +283,7 @@ type DivergeObject struct { | |||
// GetDivergingCommits returns the number of commits a targetBranch is ahead or behind a baseBranch | |||
func GetDivergingCommits(ctx context.Context, repoPath, baseBranch, targetBranch string) (do DivergeObject, err error) { | |||
cmd := NewCommand(ctx, "rev-list", "--count", "--left-right"). | |||
AddDynamicArguments(baseBranch + "..." + targetBranch) | |||
AddDynamicArguments(baseBranch + "..." + targetBranch).AddArguments("--") |
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.
Sorry, meant this change.
(Did GitHub change its mechanism what is displayed when?)
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.
And GetDivergingCommits
is covered by tests, adding --
is right here.
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.
Perhaps we should add a comment for future readers:
AddDynamicArguments(baseBranch + "..." + targetBranch).AddArguments("--") | |
AddDynamicArguments(baseBranch + "..." + targetBranch).AddArguments("--") // '--' needed so that git knows what is a reference and what is a file in case of an 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.
* origin/main: Fix loadOneBranch panic (go-gitea#29938) Fix comment review avatar alignment (go-gitea#29935) Remove the negative margin from `.page-content` (go-gitea#29922) Move notifications to a standalone file (go-gitea#29930) Remove unnecessary ".Link" usages (go-gitea#29929) Remove unnecessary ".Link" usages (go-gitea#29909) Show Actions post step when it's running (go-gitea#29926) Fix the wrong default value of ENABLE_OPENID_SIGNIN on docs (go-gitea#29925) Restore deleted branches when syncing (go-gitea#29898) Don't lock using GitHub actions (go-gitea#29913) Remove jQuery `.attr` from the user search box (go-gitea#29919) Remove jQuery `.attr` from the archive download and compare page branch selector (go-gitea#29918) Remove jQuery `.attr` from the image diff (go-gitea#29917) Remove jQuery `.attr` from the quick pull request button text (go-gitea#29916) Remove jQuery `.attr` from the issue author dropdown (go-gitea#29915)
* origin/main: Fix loadOneBranch panic (go-gitea#29938) Fix comment review avatar alignment (go-gitea#29935) Remove the negative margin from `.page-content` (go-gitea#29922) Move notifications to a standalone file (go-gitea#29930) Remove unnecessary ".Link" usages (go-gitea#29929) Remove unnecessary ".Link" usages (go-gitea#29909) Show Actions post step when it's running (go-gitea#29926) Fix the wrong default value of ENABLE_OPENID_SIGNIN on docs (go-gitea#29925) Restore deleted branches when syncing (go-gitea#29898) Don't lock using GitHub actions (go-gitea#29913) Remove jQuery `.attr` from the user search box (go-gitea#29919) Remove jQuery `.attr` from the archive download and compare page branch selector (go-gitea#29918) Remove jQuery `.attr` from the image diff (go-gitea#29917) Remove jQuery `.attr` from the quick pull request button text (go-gitea#29916) Remove jQuery `.attr` from the issue author dropdown (go-gitea#29915) Switch to the maintained vitest extension (go-gitea#29914)
Try to fix go-gitea#29936 Far from ideal, but still better than panic.
* giteaofficial/main: (34 commits) Refactor URL detection (go-gitea#29960) Solving the issue of UI disruption when the review is deleted without refreshing (go-gitea#29951) Fix JS error and improve error message styles (go-gitea#29963) Fix the bug that user may logout if he switch pages too fast (go-gitea#29962) Cancel previous runs of the same PR automatically (go-gitea#29961) Exclude `routers/private/tests` from air (go-gitea#29949) Remove codecov badge (go-gitea#29950) Misc color tweaks (go-gitea#29943) Fix and rewrite markup anchor processing (go-gitea#29931) Remove fomantic grid module (go-gitea#29894) Add background to dashboard navbar, fix missing padding (go-gitea#29940) Prevent layout shift in `<overflow-menu>` items (go-gitea#29831) Fix loadOneBranch panic (go-gitea#29938) Fix comment review avatar alignment (go-gitea#29935) Remove the negative margin from `.page-content` (go-gitea#29922) Move notifications to a standalone file (go-gitea#29930) Remove unnecessary ".Link" usages (go-gitea#29929) Remove unnecessary ".Link" usages (go-gitea#29909) Show Actions post step when it's running (go-gitea#29926) Fix the wrong default value of ENABLE_OPENID_SIGNIN on docs (go-gitea#29925) ... # Conflicts: # templates/user/dashboard/issues.tmpl
* origin/main: (332 commits) Refactor external URL detection (go-gitea#29973) Refactor repo header/list (go-gitea#29969) Fix various loading states, remove `.loading` class (go-gitea#29920) Update register application URL for GitLab (go-gitea#29959) Refactor StringsToInt64s (go-gitea#29967) Switch to happy-dom for testing (go-gitea#29948) Performance improvements for pull request list page (go-gitea#29900) Refactor URL detection (go-gitea#29960) Solving the issue of UI disruption when the review is deleted without refreshing (go-gitea#29951) Fix JS error and improve error message styles (go-gitea#29963) Fix the bug that user may logout if he switch pages too fast (go-gitea#29962) Cancel previous runs of the same PR automatically (go-gitea#29961) Exclude `routers/private/tests` from air (go-gitea#29949) Remove codecov badge (go-gitea#29950) Misc color tweaks (go-gitea#29943) Fix and rewrite markup anchor processing (go-gitea#29931) Remove fomantic grid module (go-gitea#29894) Add background to dashboard navbar, fix missing padding (go-gitea#29940) Prevent layout shift in `<overflow-menu>` items (go-gitea#29831) Fix loadOneBranch panic (go-gitea#29938) ...
Try to fix #29936
Far from ideal, but still better than panic.