Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!(clone): Use better cloning policy (#148)
* feat(github): add IsPushable function and tests Added a new function IsPushable to check if a user has push permissions based on the viewerPermission API query. Added new util file in the github package to include helper functions and facilitate unit testing on command outputs. * fix(clone): changing the test to be more reflective * feat(clone): add force fork option to clone command - Deprecated the `nofork` flag in favour of a `fork` one - Default Clone behaviour is branching instead of forking - Modified tests to reflect the changes in the clone command. * fix(code): removed unused library * docs: update README for turbolift clone usage Updated the README to clarify the usage of the `turbolift clone` command. * fix(clone): correct fork and clone logic This commit fixes the logic for forking and cloning repositories. Also changed the testing logic to include the type of call for GH. This is because the testing was just on the argument and was missing context when running the unit test. * fix(clone): update IsPushable to use full repo name Updated the IsPushable function to use the full repository name instead of the repository directory path. The gh command now uses a repository as a parameter, since the clone has not taken place yet. * fix(clone): test if permission check fail works Added a new test to verify behavior when permission check fails. Updated the log message to correctly display the repository name when determining push permissions. * refactor(tests): remove commented-out fakeGitHub instances * Update cmd/clone/clone.go Co-authored-by: Richard North <[email protected]> --------- Co-authored-by: Richard North <[email protected]>
- Loading branch information