aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-03-20 23:38:22 +0800
committerGitHub <noreply@github.com>2024-03-20 15:38:22 +0000
commit21151474e36eecc5b808963b924cd27ec34e0608 (patch)
treee3b39a71923a60fa42a5b09043b6aeda96cb3833 /modules
parentbc55a80693aded26efd856812097536e2402d491 (diff)
downloadgitea-21151474e36eecc5b808963b924cd27ec34e0608.tar.gz
gitea-21151474e36eecc5b808963b924cd27ec34e0608.zip
Fix loadOneBranch panic (#29938)
Try to fix #29936 Far from ideal, but still better than panic.
Diffstat (limited to 'modules')
-rw-r--r--modules/git/repo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/git/repo.go b/modules/git/repo.go
index cef45c6af0..4511e900e0 100644
--- a/modules/git/repo.go
+++ b/modules/git/repo.go
@@ -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("--")
stdout, _, err := cmd.RunStdString(&RunOpts{Dir: repoPath})
if err != nil {
return do, err