checkout

in lib/rugged_adapter/git_layer_rugged.rb [205:215]


      def checkout(path, ref = 'HEAD', options = {})
        path = path.nil? ? path : [path]
        options = options.merge({:paths => path, :strategy => :force})
        if ref == 'HEAD'
          @repo.checkout_head(**options)
        else
          ref = "refs/heads/#{ref}" unless ref =~ /^refs\/heads\//
          @repo.checkout_tree(sha_from_ref(ref), **options)
        end
      end