Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions lib/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
require 'git/status'
require 'git/stash'
require 'git/stashes'
require 'git/version'
require 'git/working_directory'

lib = Git::Lib.new(nil, nil)
Expand All @@ -34,15 +35,15 @@
# and more. You should be able to do most fundamental git
# operations with this library.
#
# This module provides the basic functions to open a git
# This module provides the basic functions to open a git
# reference to work with. You can open a working directory,
# open a bare repository, initialize a new repo or clone an
# existing remote repository.
#
# Author:: Scott Chacon (mailto:schacon@gmail.com)
# License:: MIT License
module Git

#g.config('user.name', 'Scott Chacon') # sets value
#g.config('user.email', 'email@email.com') # sets value
#g.config('user.name') # returns 'Scott Chacon'
Expand Down Expand Up @@ -82,7 +83,7 @@ def global_config(name = nil, value = nil)
def self.bare(git_dir, options = {})
Base.bare(git_dir, options)
end

# clones a remote repository
#
# options
Expand Down Expand Up @@ -110,7 +111,7 @@ def self.export(repository, name, options = {})
repo.checkout("origin/#{options[:branch]}") if options[:branch]
Dir.chdir(repo.dir.to_s) { FileUtils.rm_r '.git' }
end

# Same as g.config, but forces it to be at the global level
#
#g.config('user.name', 'Scott Chacon') # sets value
Expand Down Expand Up @@ -139,8 +140,8 @@ def self.global_config(name = nil, value = nil)
def self.init(working_dir = '.', options = {})
Base.init(working_dir, options)
end
# returns a Hash containing information about the references

# returns a Hash containing information about the references
# of the target repository
#
# @param [String|NilClass] location the target repository location or nil for '.'
Expand All @@ -150,7 +151,7 @@ def self.ls_remote(location=nil)
end

# open an existing git working directory
#
#
# this will most likely be the most common way to create
# a git reference, referring to a working directory.
# if not provided in the options, the library will assume
Expand All @@ -162,5 +163,5 @@ def self.ls_remote(location=nil)
def self.open(working_dir, options = {})
Base.open(working_dir, options)
end

end