microsoft/scalar

Scalar clone fails on local repo paths

jeffhostetler opened this issue · 3 comments

The scalar clone command fails on local repos paths and gives an incorrect error message.
Git-proper does allow such local repo paths.

jeffhost-mbp ~/work $ scalar clone ./gfw xxx_yyy
Clone parameters:
  Repo URL:     ./gfw
  Branch:       Default
  Cache Server: Default
  Local Cache:  /Users/jeffhost/.scalarCache
  Destination:  /Users/jeffhost/work/xxx_yyy
  FullClone:     False
Fetching objects from remote...Failed

Cannot clone @ /Users/jeffhost/work/xxx_yyy
Error: Failed to complete regular clone: fatal: './gfw' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.



jeffhost-mbp ~/work $ scalar clone file:///Users/jeffhost/work/gfw xxx_yyy
Clone parameters:
  Repo URL:     file:///Users/jeffhost/work/gfw
  Branch:       Default
  Cache Server: Default
  Local Cache:  /Users/jeffhost/.scalarCache
  Destination:  /Users/jeffhost/work/xxx_yyy
  FullClone:     False
Fetching objects from remote...Succeeded
Checking out 'master'...Succeeded



jeffhost-mbp ~/work $ git clone ./gfw yyy_zzz
Cloning into 'yyy_zzz'...
done.


jeffhost-mbp ~/work $ 

Is this something we want to support? All documentation assumes we have a URL (https or ssh).

At minimum, we should recognize that the given value doesn't look like a URL and fail earlier than the error log above.

Right, I don't know about whether it makes sense or not to allow, but either way we should have a better error message.

Frankly, I was a little surprised that the file:///... path worked. It was VERY slow though.