tiktok / sparo

Sparo optimizes performance of Git operations for your large frontend monorepo.
https://tiktok.github.io/sparo/
MIT License
162 stars 8 forks source link

Feat checkout detched #68

Closed chengcyber closed 6 months ago

chengcyber commented 6 months ago

Basic Checks

Have you run rush change for this change?

If No, please run rush change before, this is necessary.

If adding a new feature, the PR's description includes:

Does this PR introduce a breaking change? (check one)

If yes, please describe the impact and migration path for existing applications:

Summary

Fix error when running "sparo checkout" in a detached HEAD state

Detail

sparo checkout <commit_hash> can checkout to a detached HEAD state. Running "sparo checkout" again throws error which complains about "Failed to get branch name". This PR fixes this issue to allow "checkout" command in this case.

How to test it