@@ -385,7 +385,7 @@ func runGitCommandIn(dir string, arg ...string) error {
385
385
}
386
386
387
387
func createGitRepository (debsrc , gopkg , orig string , u * upstream ,
388
- includeUpstreamHistory , allowUnknownHoster , dep14 , pristineTar bool ) (string , error ) {
388
+ includeUpstreamHistory bool , allowUnknownHoster bool , debianBranch string , pristineTar bool ) (string , error ) {
389
389
wd , err := os .Getwd ()
390
390
if err != nil {
391
391
return "" , err
@@ -395,16 +395,10 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
395
395
return "" , err
396
396
}
397
397
398
- if err := runGitCommandIn (dir , "init" ); err != nil {
398
+ if err := runGitCommandIn (dir , "init" , "-b" , debianBranch ); err != nil {
399
399
return dir , err
400
400
}
401
401
402
- if dep14 {
403
- if err := runGitCommandIn (dir , "checkout" , "-q" , "-b" , "debian/sid" ); err != nil {
404
- return dir , err
405
- }
406
- }
407
-
408
402
// Set repository options
409
403
410
404
if debianName := getDebianName (); debianName != "TODO" {
@@ -437,12 +431,6 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
437
431
438
432
// Preconfigure branches
439
433
440
- var debianBranch string
441
- if dep14 {
442
- debianBranch = "debian/sid"
443
- } else {
444
- debianBranch = "master"
445
- }
446
434
branches := []string {debianBranch , "upstream" }
447
435
if pristineTar {
448
436
branches = append (branches , "pristine-tar" )
@@ -473,10 +461,7 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
473
461
474
462
// Import upstream orig tarball
475
463
476
- arg := []string {"import-orig" , "--no-interactive" }
477
- if dep14 {
478
- arg = append (arg , "--debian-branch=debian/sid" )
479
- }
464
+ arg := []string {"import-orig" , "--no-interactive" , "--debian-branch=" + debianBranch }
480
465
if pristineTar {
481
466
arg = append (arg , "--pristine-tar" )
482
467
}
@@ -859,6 +844,12 @@ func execMake(args []string, usage func()) {
859
844
log .Fatalf ("-type=%q not recognized, aborting\n " , pkgTypeString )
860
845
}
861
846
847
+ // Set the debian branch.
848
+ debBranch := "master"
849
+ if dep14 {
850
+ debBranch = "debian/sid"
851
+ }
852
+
862
853
switch strings .TrimSpace (wrapAndSort ) {
863
854
case "a" :
864
855
// Current default, also what "cme fix dpkg" generates
@@ -947,7 +938,7 @@ func execMake(args []string, usage func()) {
947
938
948
939
debversion := u .version + "-1"
949
940
950
- dir , err := createGitRepository (debsrc , gopkg , orig , u , includeUpstreamHistory , allowUnknownHoster , dep14 , pristineTar )
941
+ dir , err := createGitRepository (debsrc , gopkg , orig , u , includeUpstreamHistory , allowUnknownHoster , debBranch , pristineTar )
951
942
if err != nil {
952
943
log .Fatalf ("Could not create git repository: %v\n " , err )
953
944
}
0 commit comments