File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,8 @@ func (c *Cache) UpdateBranchRefs() error {
140
140
commit , err := c .TracByRef (name )
141
141
if err != nil {
142
142
return err
143
+ } else if commit == nil {
144
+ c .infof ("Warning: no submodule commits found for %v; skipping.\n " , name )
143
145
} else {
144
146
branches = append (branches , b )
145
147
commits = append (commits , commit )
@@ -149,10 +151,14 @@ func (c *Cache) UpdateBranchRefs() error {
149
151
if err != nil {
150
152
return err
151
153
}
154
+ if len (branches ) != len (commits ) {
155
+ return fmt .Errorf ("weird: branches=%d commits=%d" , len (branches ), len (commits ))
156
+ }
152
157
153
158
for i := range branches {
154
159
newname := string (branches [i ].Name ()) + ".trac"
155
- hash := commits [i ].Hash
160
+ cc := commits [i ]
161
+ hash := cc .Hash
156
162
c .infof ("Updating %.10v -> %v\n " , hash , newname )
157
163
158
164
refname := plumbing .ReferenceName (newname )
You can’t perform that action at this time.
0 commit comments