@@ -417,14 +417,6 @@ func runGitCommandIn(dir string, arg ...string) error {
417
417
418
418
func createGitRepository (debsrc , gopkg , orig string , u * upstream ,
419
419
includeUpstreamHistory bool , allowUnknownHoster bool , debianBranch string , dep14 bool , pristineTar bool ) (string , error ) {
420
-
421
- // debianBranch is passed in function call, but upstream import branch needs
422
- // also to be defined
423
- upstreamImportBranch := "upstream"
424
- if dep14 {
425
- upstreamImportBranch = "upstream/latest"
426
- }
427
-
428
420
wd , err := os .Getwd ()
429
421
if err != nil {
430
422
return "" , fmt .Errorf ("get cwd: %w" , err )
@@ -470,8 +462,7 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
470
462
471
463
// Preconfigure branches
472
464
473
- branches := []string {debianBranch , upstreamImportBranch }
474
-
465
+ branches := []string {debianBranch , "upstream/latest" }
475
466
if pristineTar {
476
467
branches = append (branches , "pristine-tar" )
477
468
}
@@ -485,8 +476,13 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
485
476
}
486
477
487
478
if includeUpstreamHistory {
488
- // Always call the upstream git remote 'upstreamvcs' just like git-buildpackage does
489
- u .remote = "upstreamvcs"
479
+ u .remote , err = shortHostName (gopkg , allowUnknownHoster )
480
+ if err != nil {
481
+ return dir , fmt .Errorf ("unable to fetch upstream history: %q" , err )
482
+ }
483
+ if u .remote == "debian" {
484
+ u .remote = "salsa"
485
+ }
490
486
log .Printf ("Adding remote %q with URL %q\n " , u .remote , u .rr .Repo )
491
487
if err := runGitCommandIn (dir , "remote" , "add" , u .remote , u .rr .Repo ); err != nil {
492
488
return dir , fmt .Errorf ("git remote add %s %s: %w" , u .remote , u .rr .Repo , err )
@@ -498,13 +494,10 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
498
494
}
499
495
500
496
// Import upstream orig tarball
501
- // (and release git tag if includeUpstreamHistory)
502
497
503
- arg := []string {
504
- "import-orig" ,
505
- "--no-interactive" ,
506
- "--debian-branch=" + debianBranch ,
507
- "--upstream-branch=" + upstreamImportBranch ,
498
+ arg := []string {"import-orig" , "--no-interactive" , "--debian-branch=" + debianBranch }
499
+ if dep14 {
500
+ arg = append (arg , "--upstream-branch=upstream/latest" )
508
501
}
509
502
if pristineTar {
510
503
arg = append (arg , "--pristine-tar" )
0 commit comments