class CreateGithubRelease::Assertions::NoStagedChanges
@api public
Checks both the local repository and the remote repository.
Assert that there are no staged changes in the local repository
def assert
-
(SystemExit)
- if the assertion fails
Returns:
-
(void)
-
def assert print 'Checking that there are no staged changes...' change_count = `git diff --staged --name-only | wc -l`.to_i error "git diff command failed: #{$CHILD_STATUS.exitstatus}" unless $CHILD_STATUS.success? if change_count.zero? puts 'OK' else error 'There are staged changes' end end