iceberg icon indicating copy to clipboard operation
iceberg copied to clipboard

Enable option to use local git cache of git repo if there are network issues when trying to connect to remote

Open botwhytho opened this issue 3 years ago • 1 comments

When running code like below, if there is no network connection, the code will fail, even if there is a local git copy on the machine.

Metacello new
    baseline: 'MyProject';
    repository: 'github://myproject';
    load.

botwhytho avatar Jun 22 '22 03:06 botwhytho

I've coded workarounds like below, but considering I'm introspecting with instVarNamed: we probably need to expose error codes from libgit a bit more officially

[Metacello new
  baseline: 'ABaseline';
  repository: 'github://aPath';
  load. ]
on: IceGenericError
do: [:anError|
  (anError instVarNamed: #wrappedException) object = LGitErrorTypeEnum giterr_net
    ifTrue: [
      Metacello new
      baseline: 'ABaseline';
      repository: 'gitlocal://aPath';
      load.			
]

botwhytho avatar Jun 22 '22 03:06 botwhytho