twosigma / git-meta

Repository for the git-meta project -- build your own monorepo using Git submodules
http://twosigma.github.io/git-meta
BSD 3-Clause "New" or "Revised" License
219 stars 50 forks source link

avoid exceptions from calling git-meta checkout on unopened submodules #792

Closed tsuikevi-twosigma closed 4 years ago

tsuikevi-twosigma commented 4 years ago

Running git meta checkout throws an error if it's passed a path to an unopened submodule e.g.

~/P/g/foo [master]× » gm checkout -- .
Error: could not find repository from '/Users/kevintsui/Projects/git-meta/foo/au/gp/unm'

This change avoids this error by not applying the checkout operation to unopened submodules.

tsuikevi-twosigma commented 4 years ago

Ended up only covering the case where $rev is empty. Checking for HEAD was doable but not as clean as I would have liked for this partial fix so decided not to implement it.