Sha256: 8ef6153080f46fb15739742d109567772c7ee6d7e35bec8c3e87d706293e54b8

Contents?: true

Size: 749 Bytes

Versions: 8

Compression:

Stored size: 749 Bytes

Contents

module Fastlane
  module Actions
    # Does a hard reset and clean on the repo
    class ResetGitRepoAction
      def self.run(params)
        if params.include?(:force) || Actions.lane_context[SharedValues::GIT_REPO_WAS_CLEAN_ON_START]
          Actions.sh('git reset --hard HEAD')
          Actions.sh('git clean -qfdx')
          Helper.log.info 'Git repo was reset and cleaned back to a pristine state.'.green
        else
          raise 'This is a destructive and potentially dangerous action. To protect from data loss, please add the `ensure_git_status_clean` action to the beginning of your lane, or if you\'re absolutely sure of what you\'re doing then call this action with the :force option.'.red
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fastlane-0.5.0 lib/fastlane/actions/reset_git_repo.rb
fastlane-0.4.2 lib/fastlane/actions/reset_git_repo.rb
fastlane-0.4.1 lib/fastlane/actions/reset_git_repo.rb
fastlane-0.4.0 lib/fastlane/actions/reset_git_repo.rb
fastlane-0.3.0 lib/fastlane/actions/reset_git_repo.rb
fastlane-0.2.1 lib/fastlane/actions/reset_git_repo.rb
fastlane-0.2.0 lib/fastlane/actions/reset_git_repo.rb
fastlane-0.1.19 lib/fastlane/actions/reset_git_repo.rb