tangled
alpha
login
or
join now
back
round
0
view raw
knotserver: fix commit counting for branch creation
#447
merged
opened by
oppi.li
5 months ago
targeting
master
from
push-ytkuzknmmrmn
rev-list was over-counting
Signed-off-by: oppiliappan
me@oppi.li
options
unified
split
Changed files
+9
-1
knotserver
git
post_receive.go
+9
-1
knotserver/git/post_receive.go
···
95
95
args := []string{fmt.Sprintf("--max-count=%d", 100)}
96
96
97
97
if line.OldSha.IsZero() {
98
98
-
// just git rev-list <newsha>
98
98
+
// git rev-list <newsha> ^other-branches --not ^this-branch
99
99
args = append(args, line.NewSha.String())
100
100
+
101
101
+
branches, _ := g.Branches()
102
102
+
for _, b := range branches {
103
103
+
args = append(args, fmt.Sprintf("^%s", b.Name))
104
104
+
}
105
105
+
106
106
+
args = append(args, "--not")
107
107
+
args = append(args, fmt.Sprintf("^%s", line.Ref))
100
108
} else {
101
109
// git rev-list <oldsha>..<newsha>
102
110
args = append(args, fmt.Sprintf("%s..%s", line.OldSha.String(), line.NewSha.String()))