File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -597,15 +597,21 @@ func buildPushRequest(updates map[string]RefUpdate) []byte {
597597
598598 first := true
599599 for _ , update := range updates {
600+ // use zero hash for new branches
601+ oldHash := update .OldHash
602+ if oldHash == "" {
603+ oldHash = "0000000000000000000000000000000000000000"
604+ }
605+
600606 var line string
601607 if first {
602608 // Include capabilities on first command
603609 line = fmt .Sprintf ("%s %s %s\x00 report-status side-band-64k\n " ,
604- update . OldHash , update .NewHash , update .RefName )
610+ oldHash , update .NewHash , update .RefName )
605611 first = false
606612 } else {
607613 line = fmt .Sprintf ("%s %s %s\n " ,
608- update . OldHash , update .NewHash , update .RefName )
614+ oldHash , update .NewHash , update .RefName )
609615 }
610616
611617 pktLine := fmt .Sprintf ("%04x%s" , len (line )+ 4 , line )
You can’t perform that action at this time.
0 commit comments