Skip to content

Commit 911f0ad

Browse files
committed
Revert "Always call upstream git remote upstreamvcs"
This reverts commit 7040600. This got push back on the debian-devel mailing list, and there is no general agreement in the project that it is a good idea. The only reason this was pushed is that git-buildpackage currently uses this default.
1 parent 6f4fbdd commit 911f0ad

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

make.go

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,6 @@ func runGitCommandIn(dir string, arg ...string) error {
417417

418418
func createGitRepository(debsrc, gopkg, orig string, u *upstream,
419419
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-
428420
wd, err := os.Getwd()
429421
if err != nil {
430422
return "", fmt.Errorf("get cwd: %w", err)
@@ -470,8 +462,7 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
470462

471463
// Preconfigure branches
472464

473-
branches := []string{debianBranch, upstreamImportBranch}
474-
465+
branches := []string{debianBranch, "upstream/latest"}
475466
if pristineTar {
476467
branches = append(branches, "pristine-tar")
477468
}
@@ -485,8 +476,13 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
485476
}
486477

487478
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+
}
490486
log.Printf("Adding remote %q with URL %q\n", u.remote, u.rr.Repo)
491487
if err := runGitCommandIn(dir, "remote", "add", u.remote, u.rr.Repo); err != nil {
492488
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,
498494
}
499495

500496
// Import upstream orig tarball
501-
// (and release git tag if includeUpstreamHistory)
502497

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")
508501
}
509502
if pristineTar {
510503
arg = append(arg, "--pristine-tar")

0 commit comments

Comments
 (0)