Skip to content

Commit

Permalink
Keep compatibility with Git below 2.28
Browse files Browse the repository at this point in the history
Thanks to Alois Micard for pointing that out
  • Loading branch information
elboulangero committed Aug 3, 2021
1 parent 56822f2 commit f71543b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion make.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,16 @@ func createGitRepository(debsrc, gopkg, orig string, u *upstream,
return "", err
}

if err := runGitCommandIn(dir, "init", "-b", debianBranch); err != nil {
// "git init -b" is the one-liner we need here, however it was added in Git 2.28.
// For now we prefer to keep compatibility with older Git, so we do it in two
// rounds, "git init" then "git checkout".
//if err := runGitCommandIn(dir, "init", "-b", debianBranch); err != nil {
// return dir, err
//}
if err := runGitCommandIn(dir, "init"); err != nil {
return dir, err
}
if err := runGitCommandIn(dir, "checkout", "-q", "-b", debianBranch); err != nil {
return dir, err
}

Expand Down

0 comments on commit f71543b

Please sign in to comment.