vcstool icon indicating copy to clipboard operation
vcstool copied to clipboard

Could not checkout ref '...': fatal: invalid reference

Open andry81 opened this issue 2 years ago • 1 comments
trafficstars

Sometimes could not checkout ref error happens.

Steps to reproduce:

  1. Create a repo with 1_2_3_20201010 branch (ex: https://github.com/andry81-tests/vcstool-test-A)
  2. Switch to master branch:
    git switch --orphan master
    
  3. Create .externals:
    repositories:
    
      _externals/1_2_3_20201010:
        type:             git
        url:              https://github.com/andry81-tests/vcstool-test-A
        version:          1_2_3_20201010
    
  4. Import .externals:
    vcs import < .externals
    

    === ._externals/1_2_3_20201010 (git) === Could not checkout ref '12320201010': fatal: invalid reference: 12320201010

>git --version
git version 2.24.0.windows.2

andry81 avatar Mar 11 '23 16:03 andry81

Seems bug in the yaml parser, because this works:

repositories:

  _externals/1_2_3_20201010:
    type:             git
    url:              https://github.com/andry81-tests/vcstool-test-A
    version:          '1_2_3_20201010'

andry81 avatar Mar 11 '23 16:03 andry81