Sha256: ce9b7790d9af96d47c8d8406dc0d07164e36fe5ed1a65ca3d088dd52cbf1a962

Contents?: true

Size: 1.6 KB

Versions: 2

Compression:

Stored size: 1.6 KB

Contents

module Autowow
  module Commands
    module Vcs
      def changes_not_on_remote(branch)
        ['git', 'log', branch, '--not', '--remotes']
      end

      def branch_list
        ["git for-each-ref --format='%(refname)' refs/heads/"]
        # TODO: report error with following command
        # ['git', 'for-each-ref', "--format='%(refname)'", 'refs/heads/']
      end

      def push(branch = nil, remote = nil)
        ['git', 'push'] + [branch, remote].compact
      end

      def rebase(branch)
        ['git', 'rebase', branch]
      end

      def git_status
        ['git', 'status']
      end

      def stash
        ['git', 'stash']
      end

      def stash_pop
        ['git', 'stash', 'pop']
      end

      def current_branch
        ['git', 'symbolic-ref', '--short', 'HEAD']
      end

      def checkout(existing_branch)
        ['git', 'checkout', existing_branch]
      end

      def pull
        ['git', 'pull']
      end

      def branch_force_delete(branch)
        ['git', 'branch', '-D', branch]
      end

      def create(branch)
        ['git', 'checkout', '-b', branch]
      end

      def set_upstream(remote, branch)
        ['git', 'push', '--set-upstream', remote, branch]
      end

      def remotes
        ['git', 'remote', '-v']
      end

      def fetch(remote)
        ['git', 'fetch', remote]
      end

      def merge(compare)
        ['git', 'merge', compare]
      end

      def branch
        ['git', 'branch']
      end

      def add_remote(name, url)
        ['git', 'remote', 'add', name, url]
      end

      include ReflectionUtils::CreateModuleFunctions
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
autowow-0.4.1 lib/autowow/commands/vcs.rb
autowow-0.4.0 lib/autowow/commands/vcs.rb