Skip to content
GitLab
    • Why GitLab
    • Pricing
    • Contact Sales
    • Explore
  • Why GitLab
  • Pricing
  • Contact Sales
  • Explore
  • Sign in
  • Get free trial
  • libvirt libvirt
  • libvirt-cilibvirt-ci
  • Repository
  • libvirt-ci
  • containers
  • check-dco
  • check-dco.py
Find file Blame History Permalink
  • Daniel P. Berrangé's avatar
    check-dco: improve logic for finding default branch · 330ee23f
    Daniel P. Berrangé authored Sep 09, 2022
    The previous commit to dynamically detect the default branch
    name (instead of assuming 'master') only worked if the fork
    repo used the same default branch name as upstream. This is
    only likely to be the case for forks created after the
    upstream branch rename, and even then developers might change
    their fork's default branch name.
    
    Fortunately 'git remote show' prints info including the
    default branch name:
    
    $ git remote show check-dco
    * remote check-dco
      Fetch URL: https://gitlab.com/libosinfo/osinfo-db.git
      Push  URL: https://gitlab.com/libosinfo/osinfo-db.git
    
    
      HEAD branch: main
      Remote branch:
        main new (next fetch will store in remotes/check-dco)
    
    Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
    330ee23f