@@ -411,6 +411,8 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
411
411
return dir , err
412
412
}
413
413
414
+ // [remote "origin"]
415
+
414
416
originURL := "[email protected] :go-team/packages/" + debsrc + ".git"
415
417
log .Printf ("Adding remote \" origin\" with URL %q\n " , originURL )
416
418
if err := runGitCommandIn (dir , "remote" , "add" , "origin" , originURL ); err != nil {
@@ -423,6 +425,27 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
423
425
return dir , err
424
426
}
425
427
428
+ // Preconfigure branches
429
+
430
+ var debianBranch string
431
+ if dep14 {
432
+ debianBranch = "debian/sid"
433
+ } else {
434
+ debianBranch = "master"
435
+ }
436
+ branches := []string {debianBranch , "upstream" }
437
+ if pristineTar {
438
+ branches = append (branches , "pristine-tar" )
439
+ }
440
+ for _ , branch := range branches {
441
+ if err := runGitCommandIn (dir , "config" , "branch." + branch + ".remote" , "origin" ); err != nil {
442
+ return dir , err
443
+ }
444
+ if err := runGitCommandIn (dir , "config" , "branch." + branch + ".merge" , "refs/heads/" + branch ); err != nil {
445
+ return dir , err
446
+ }
447
+ }
448
+
426
449
if includeUpstreamHistory {
427
450
u .remote , err = shortHostName (gopkg , allowUnknownHoster )
428
451
if err != nil {
0 commit comments