summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hook.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/hook.go b/cmd/hook.go
index 0ddbb36f90..9d805e4ef5 100644
--- a/cmd/hook.go
+++ b/cmd/hook.go
@@ -118,7 +118,7 @@ func runHookPreReceive(c *cli.Context) error {
if protectBranch != nil && protectBranch.IsProtected() {
// detect force push
if git.EmptySHA != oldCommitID {
- output, err := git.NewCommand("rev-list", oldCommitID, "^"+newCommitID).RunInDir(repoPath)
+ output, err := git.NewCommand("rev-list", "--max-count=1", oldCommitID, "^"+newCommitID).RunInDir(repoPath)
if err != nil {
fail("Internal error", "Fail to detect force push: %v", err)
} else if len(output) > 0 {