pax_global_header 0000666 0000000 0000000 00000000064 12366517705 0014526 g ustar 00root root 0000000 0000000 52 comment=8425a6b6169eaeda0afe2e16b0e4210ed433caf2
ruby-git-1.2.8/ 0000775 0000000 0000000 00000000000 12366517705 0013300 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/.gitignore 0000664 0000000 0000000 00000000073 12366517705 0015270 0 ustar 00root root 0000000 0000000 *.gem
*.kpf
*.sw?
.DS_Store
coverage
pkg
rdoc
Gemfile.lock
ruby-git-1.2.8/.jrubyrc 0000664 0000000 0000000 00000000022 12366517705 0014753 0 ustar 00root root 0000000 0000000 cext.enabled=true
ruby-git-1.2.8/.travis.yml 0000664 0000000 0000000 00000000252 12366517705 0015410 0 ustar 00root root 0000000 0000000 language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1
- jruby-18mode
- jruby-19mode
- ree
matrix:
allow_failures:
- rbx-18mode
- rbx-19mode
ruby-git-1.2.8/Gemfile 0000664 0000000 0000000 00000000067 12366517705 0014576 0 ustar 00root root 0000000 0000000 source 'https://rubygems.org'
gemspec :name => 'git'
ruby-git-1.2.8/History.txt 0000664 0000000 0000000 00000002610 12366517705 0015501 0 ustar 00root root 0000000 0000000 == 1.2.8
* Keeping the old escape format for windows users
* revparse: Supporting ref names containing SHA like substrings (40-hex strings)
* Fix warnings on Ruby 2.1.2
== 1.2.7
* Fixing mesages encoding
* Fixing -f flag in git push
* Fixing log parser for multiline messages
* Supporting object references on Git.add_tag
* Including dotfiles on Git.status
* Git.fetch - supporting --tags
* Git.clean - supporting -x
* Git.add_tag options - supporting -a, -m and -s
* Added Git.delete_tag
== 1.2.6
* Ruby 1.9.X/2.0 fully supported
* JRuby 1.8/1.9 support
* Rubinius support
* Git.clone - supporting --recursive and --config
* Git.log - supporting last and [] over the results
* Git.add_remote - supporting -f and -t
* Git.add - supporting --fore
* Git.init - supporting --bare
* Git.commit - supporting --all and --amend
* Added Git.remote_remote, Git.revert and Git.clean
* Added Bundler to the formula
* Travis configuration
* Licence included with the gem
== 1.0.4
* added camping/gitweb.rb frontend
* added a number of speed-ups
== 1.0.3
* Sped up most of the operations
* Added some predicate functions (commit?, tree?, etc)
* Added a number of lower level operations (read-tree, write-tree, checkout-index, etc)
* Fixed a bug with using bare repositories
* Updated a good amount of the documentation
== 1.0.2
* Added methods to the git objects that might be helpful
== 1.0.1
* Initial version
ruby-git-1.2.8/LICENSE 0000664 0000000 0000000 00000002061 12366517705 0014304 0 ustar 00root root 0000000 0000000 The MIT License
Copyright (c) 2008 Scott Chacon
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
ruby-git-1.2.8/README.md 0000664 0000000 0000000 00000017145 12366517705 0014567 0 ustar 00root root 0000000 0000000 # Git Library for Ruby
Library for using Git in Ruby.
## Homepage
Git public hosting of the project source code is at:
http://github.com/schacon/ruby-git
## Install
You can install Ruby/Git like this:
$ sudo gem install git
## Code Status
* [](https://travis-ci.org/schacon/ruby-git)
* [](https://codeclimate.com/github/schacon/ruby-git)
* [](http://badge.fury.io/rb/git)
* [](https://gemnasium.com/schacon/ruby-git)
## Major Objects
**Git::Base** - The object returned from a `Git.open` or `Git.clone`. Most major actions are called from this object.
**Git::Object** - The base object for your tree, blob and commit objects, returned from `@git.gtree` or `@git.object` calls. the `Git::AbstractObject` will have most of the calls in common for all those objects.
**Git::Diff** - returns from a `@git.diff` command. It is an Enumerable that returns `Git::Diff:DiffFile` objects from which you can get per file patches and insertion/deletion statistics. You can also get total statistics from the Git::Diff object directly.
**Git::Status** - returns from a `@git.status` command. It is an Enumerable that returns
`Git:Status::StatusFile` objects for each object in git, which includes files in the working
directory, in the index and in the repository. Similar to running 'git status' on the command line to determine untracked and changed files.
**Git::Branches** - Enumerable object that holds `Git::Branch objects`. You can call .local or .remote on it to filter to just your local or remote branches.
**Git::Remote**- A reference to a remote repository that is tracked by this repository.
**Git::Log** - An Enumerable object that references all the `Git::Object::Commit` objects that encompass your log query, which can be constructed through methods on the `Git::Log object`,
like:
`@git.log(20).object("some_file").since("2 weeks ago").between('v2.6', 'v2.7').each { |commit| [block] }`
## Examples
Here are a bunch of examples of how to use the Ruby/Git package.
Ruby < 1.9 will require rubygems to be loaded.
```ruby
require 'rubygems'
```
Require the 'git' gem.
```ruby
require 'git'
```
Here are the operations that need read permission only.
```ruby
g = Git.open(working_dir, :log => Logger.new(STDOUT))
g.index
g.index.readable?
g.index.writable?
g.repo
g.dir
g.log # returns array of Git::Commit objects
g.log.since('2 weeks ago')
g.log.between('v2.5', 'v2.6')
g.log.each {|l| puts l.sha }
g.gblob('v2.5:Makefile').log.since('2 weeks ago')
g.object('HEAD^').to_s # git show / git rev-parse
g.object('HEAD^').contents
g.object('v2.5:Makefile').size
g.object('v2.5:Makefile').sha
g.gtree(treeish)
g.gblob(treeish)
g.gcommit(treeish)
commit = g.gcommit('1cc8667014381')
commit.gtree
commit.parent.sha
commit.parents.size
commit.author.name
commit.author.email
commit.author.date.strftime("%m-%d-%y")
commit.committer.name
commit.date.strftime("%m-%d-%y")
commit.message
tree = g.gtree("HEAD^{tree}")
tree.blobs
tree.subtrees
tree.children # blobs and subtrees
g.revparse('v2.5:Makefile')
g.branches # returns Git::Branch objects
g.branches.local
g.branches.remote
g.branches[:master].gcommit
g.branches['origin/master'].gcommit
g.grep('hello') # implies HEAD
g.blob('v2.5:Makefile').grep('hello')
g.tag('v2.5').grep('hello', 'docs/')
g.diff(commit1, commit2).size
g.diff(commit1, commit2).stats
g.gtree('v2.5').diff('v2.6').insertions
g.diff('gitsearch1', 'v2.5').path('lib/')
g.diff('gitsearch1', @git.gtree('v2.5'))
g.diff('gitsearch1', 'v2.5').path('docs/').patch
g.gtree('v2.5').diff('v2.6').patch
g.gtree('v2.5').diff('v2.6').each do |file_diff|
puts file_diff.path
puts file_diff.patch
puts file_diff.blob(:src).contents
end
g.config('user.name') # returns 'Scott Chacon'
g.config # returns whole config hash
g.tags # returns array of Git::Tag objects
```
And here are the operations that will need to write to your git repository.
```ruby
g = Git.init
Git.init('project')
Git.init('/home/schacon/proj',
{ :repository => '/opt/git/proj.git',
:index => '/tmp/index'} )
g = Git.clone(URI, NAME, :path => '/tmp/checkout')
g.config('user.name', 'Scott Chacon')
g.config('user.email', 'email@email.com')
g.add # git add -- "."
g.add(:all=>true) # git add --all -- "."
g.add('file_path') # git add -- "file_path"
g.add(['file_path_1', 'file_path_2']) # git add -- "file_path_1" "file_path_2"
g.remove('file.txt')
g.remove(['file.txt', 'file2.txt'])
g.commit('message')
g.commit_all('message')
g = Git.clone(repo, 'myrepo')
g.chdir do
new_file('test-file', 'blahblahblah')
g.status.changed.each do |file|
puts file.blob(:index).contents
end
end
g.reset # defaults to HEAD
g.reset_hard(Git::Commit)
g.branch('new_branch') # creates new or fetches existing
g.branch('new_branch').checkout
g.branch('new_branch').delete
g.branch('existing_branch').checkout
g.checkout('new_branch')
g.checkout(g.branch('new_branch'))
g.branch(name).merge(branch2)
g.branch(branch2).merge # merges HEAD with branch2
g.branch(name).in_branch(message) { # add files } # auto-commits
g.merge('new_branch')
g.merge('origin/remote_branch')
g.merge(g.branch('master'))
g.merge([branch1, branch2])
r = g.add_remote(name, uri) # Git::Remote
r = g.add_remote(name, Git::Base) # Git::Remote
g.remotes # array of Git::Remotes
g.remote(name).fetch
g.remote(name).remove
g.remote(name).merge
g.remote(name).merge(branch)
g.fetch
g.fetch(g.remotes.first)
g.pull
g.pull(Git::Repo, Git::Branch) # fetch and a merge
g.add_tag('tag_name') # returns Git::Tag
g.add_tag('tag_name', 'object_reference')
g.add_tag('tag_name', 'object_reference', {:options => 'here'})
g.add_tag('tag_name', {:options => 'here'})
Options:
:a | :annotate
:d
:f
:m | :message
:s
g.delete_tag('tag_name')
g.repack
g.push
g.push(g.remote('name'))
```
Some examples of more low-level index and tree operations
```ruby
g.with_temp_index do
g.read_tree(tree3) # calls self.index.read_tree
g.read_tree(tree1, :prefix => 'hi/')
c = g.commit_tree('message')
# or #
t = g.write_tree
c = g.commit_tree(t, :message => 'message', :parents => [sha1, sha2])
g.branch('branch_name').update_ref(c)
g.update_ref(branch, c)
g.with_temp_working do # new blank working directory
g.checkout
g.checkout(another_index)
g.commit # commits to temp_index
end
end
g.set_index('/path/to/index')
g.with_index(path) do
# calls set_index, then switches back after
end
g.with_working(dir) do
# calls set_working, then switches back after
end
g.with_temp_working(dir) do
g.checkout_index(:prefix => dir, :path_limiter => path)
# do file work
g.commit # commits to index
end
```
## License
licensed under MIT License Copyright (c) 2008 Scott Chacon. See LICENSE for further details.
ruby-git-1.2.8/Rakefile 0000664 0000000 0000000 00000000633 12366517705 0014747 0 ustar 00root root 0000000 0000000 require 'rubygems'
require "#{File.expand_path(File.dirname(__FILE__))}/lib/git/version"
task :default => :test
desc 'Run Unit Tests'
task :test do |t|
sh 'git config --global user.email "git@example.com"' if `git config user.email`.empty?
sh 'git config --global user.name "GitExample"' if `git config user.name`.empty?
$VERBOSE = true
require File.dirname(__FILE__) + '/tests/all_tests.rb'
end
ruby-git-1.2.8/VERSION 0000664 0000000 0000000 00000000006 12366517705 0014344 0 ustar 00root root 0000000 0000000 1.2.8
ruby-git-1.2.8/git.gemspec 0000664 0000000 0000000 00000002475 12366517705 0015440 0 ustar 00root root 0000000 0000000 require 'date'
require "#{File.expand_path(File.dirname(__FILE__))}/lib/git/version"
Gem::Specification.new do |s|
s.authors = ['Scott Chacon']
s.date = Date.today.to_s
s.email = 'schacon@gmail.com'
s.homepage = 'http://github.com/schacon/ruby-git'
s.license = 'MIT'
s.name = 'git'
s.summary = 'Ruby/Git is a Ruby library that can be used to create, read and manipulate Git repositories by wrapping system calls to the git binary.'
s.version = Git::VERSION
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ['lib']
s.requirements = ['git 1.6.0.0, or greater']
s.add_development_dependency 'rake'
s.add_development_dependency 'rdoc'
s.add_development_dependency 'test-unit'
s.extra_rdoc_files = ['README.md']
s.rdoc_options = ['--charset=UTF-8']
s.files = [
'LICENSE',
'lib/git.rb',
'lib/git/author.rb',
'lib/git/base.rb',
'lib/git/branch.rb',
'lib/git/branches.rb',
'lib/git/diff.rb',
'lib/git/index.rb',
'lib/git/lib.rb',
'lib/git/log.rb',
'lib/git/object.rb',
'lib/git/path.rb',
'lib/git/remote.rb',
'lib/git/repository.rb',
'lib/git/stash.rb',
'lib/git/stashes.rb',
'lib/git/status.rb',
'lib/git/version.rb',
'lib/git/working_directory.rb'
]
end
ruby-git-1.2.8/lib/ 0000775 0000000 0000000 00000000000 12366517705 0014046 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/lib/git.rb 0000664 0000000 0000000 00000011014 12366517705 0015153 0 ustar 00root root 0000000 0000000 # Add the directory containing this file to the start of the load path if it
# isn't there already.
$:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
require 'git/author'
require 'git/base'
require 'git/branch'
require 'git/branches'
require 'git/diff'
require 'git/index'
require 'git/lib'
require 'git/log'
require 'git/object'
require 'git/path'
require 'git/remote'
require 'git/repository'
require 'git/status'
require 'git/stash'
require 'git/stashes'
require 'git/working_directory'
lib = Git::Lib.new(nil, nil)
unless lib.meets_required_version?
$stderr.puts "[WARNING] The git gem requires git #{lib.required_command_version.join('.')} or later, but only found #{lib.current_command_version.join('.')}. You should probably upgrade."
end
# Git/Ruby Library
#
# This provides bindings for working with git in complex
# interactions, including branching and merging, object
# inspection and manipulation, history, patch generation
# 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
# 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'
#g.config # returns whole config hash
def config(name = nil, value = nil)
lib = Git::Lib.new
if(name && value)
# set value
lib.config_set(name, value)
elsif (name)
# return value
lib.config_get(name)
else
# return hash
lib.config_list
end
end
def global_config(name = nil, value = nil)
self.class.global_config(name, value)
end
# open a bare repository
#
# this takes the path to a bare git repo
# it expects not to be able to use a working directory
# so you can't checkout stuff, commit things, etc.
# but you can do most read operations
def self.bare(git_dir, options = {})
Base.bare(git_dir, options)
end
# clones a remote repository
#
# options
# :bare => true (does a bare clone)
# :repository => '/path/to/alt_git_dir'
# :index => '/path/to/alt_index_file'
#
# example
# Git.clone('git://repo.or.cz/rubygit.git', 'clone.git', :bare => true)
#
def self.clone(repository, name, options = {})
Base.clone(repository, name, options)
end
# Export the current HEAD (or a branch, if options[:branch]
# is specified) into the +name+ directory, then remove all traces of git from the
# directory.
#
# See +clone+ for options. Does not obey the :remote option,
# since the .git info will be deleted anyway; always uses the default
# remote, 'origin.'
def self.export(repository, name, options = {})
options.delete(:remote)
repo = clone(repository, name, {:depth => 1}.merge(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
#g.config('user.email', 'email@email.com') # sets value
#g.config('user.name') # returns 'Scott Chacon'
#g.config # returns whole config hash
def self.global_config(name = nil, value = nil)
lib = Git::Lib.new(nil, nil)
if(name && value)
# set value
lib.global_config_set(name, value)
elsif (name)
# return value
lib.global_config_get(name)
else
# return hash
lib.global_config_list
end
end
# initialize a new git repository, defaults to the current working directory
#
# options
# :repository => '/path/to/alt_git_dir'
# :index => '/path/to/alt_index_file'
def self.init(working_dir = '.', options = {})
Base.init(working_dir, options)
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
# your git_dir and index are in the default place (.git/, .git/index)
#
# options
# :repository => '/path/to/alt_git_dir'
# :index => '/path/to/alt_index_file'
def self.open(working_dir, options = {})
Base.open(working_dir, options)
end
end
ruby-git-1.2.8/lib/git/ 0000775 0000000 0000000 00000000000 12366517705 0014631 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/lib/git/author.rb 0000664 0000000 0000000 00000000423 12366517705 0016457 0 ustar 00root root 0000000 0000000 module Git
class Author
attr_accessor :name, :email, :date
def initialize(author_string)
if m = /(.*?) <(.*?)> (\d+) (.*)/.match(author_string)
@name = m[1]
@email = m[2]
@date = Time.at(m[3].to_i)
end
end
end
end ruby-git-1.2.8/lib/git/base.rb 0000664 0000000 0000000 00000036056 12366517705 0016102 0 ustar 00root root 0000000 0000000 module Git
class Base
# opens a bare Git Repository - no working directory options
def self.bare(git_dir, opts = {})
self.new({:repository => git_dir}.merge(opts))
end
# opens a new Git Project from a working directory
# you can specify non-standard git_dir and index file in the options
def self.open(working_dir, opts={})
self.new({:working_directory => working_dir}.merge(opts))
end
# initializes a git repository
#
# options:
# :bare
# :index
# :repository
#
def self.init(working_dir, opts = {})
opts[:working_directory] = working_dir if !opts[:working_directory]
opts[:repository] = File.join(opts[:working_directory], '.git') if !opts[:repository]
FileUtils.mkdir_p(opts[:working_directory]) if opts[:working_directory] && !File.directory?(opts[:working_directory])
init_opts = {
:bare => opts[:bare]
}
opts.delete(:working_directory) if opts[:bare]
Git::Lib.new(opts).init(init_opts)
self.new(opts)
end
# clones a git repository locally
#
# repository - http://repo.or.cz/w/sinatra.git
# name - sinatra
#
# options:
# :repository
#
# :bare
# or
# :working_directory
# :index_file
#
def self.clone(repository, name, opts = {})
# run git-clone
self.new(Git::Lib.new.clone(repository, name, opts))
end
def initialize(options = {})
if working_dir = options[:working_directory]
options[:repository] ||= File.join(working_dir, '.git')
options[:index] ||= File.join(working_dir, '.git', 'index')
end
if options[:log]
@logger = options[:log]
@logger.info("Starting Git")
else
@logger = nil
end
@working_directory = options[:working_directory] ? Git::WorkingDirectory.new(options[:working_directory]) : nil
@repository = options[:repository] ? Git::Repository.new(options[:repository]) : nil
@index = options[:index] ? Git::Index.new(options[:index], false) : nil
end
# returns a reference to the working directory
# @git.dir.path
# @git.dir.writeable?
def dir
@working_directory
end
# returns reference to the git repository directory
# @git.dir.path
def repo
@repository
end
# returns reference to the git index file
def index
@index
end
def set_working(work_dir, check = true)
@lib = nil
@working_directory = Git::WorkingDirectory.new(work_dir.to_s, check)
end
def set_index(index_file, check = true)
@lib = nil
@index = Git::Index.new(index_file.to_s, check)
end
# changes current working directory for a block
# to the git working directory
#
# example
# @git.chdir do
# # write files
# @git.add
# @git.commit('message')
# end
def chdir # :yields: the Git::Path
Dir.chdir(dir.path) do
yield dir.path
end
end
# returns the repository size in bytes
def repo_size
Dir.chdir(repo.path) do
return `du -s`.chomp.split.first.to_i
end
end
#g.config('user.name', 'Scott Chacon') # sets value
#g.config('user.email', 'email@email.com') # sets value
#g.config('user.name') # returns 'Scott Chacon'
#g.config # returns whole config hash
def config(name = nil, value = nil)
if(name && value)
# set value
lib.config_set(name, value)
elsif (name)
# return value
lib.config_get(name)
else
# return hash
lib.config_list
end
end
# factory methods
# returns a Git::Object of the appropriate type
# you can also call @git.gtree('tree'), but that's
# just for readability. If you call @git.gtree('HEAD') it will
# still return a Git::Object::Commit object.
#
# @git.object calls a factory method that will run a rev-parse
# on the objectish and determine the type of the object and return
# an appropriate object for that type
def object(objectish)
Git::Object.new(self, objectish)
end
def gtree(objectish)
Git::Object.new(self, objectish, 'tree')
end
def gcommit(objectish)
Git::Object.new(self, objectish, 'commit')
end
def gblob(objectish)
Git::Object.new(self, objectish, 'blob')
end
# returns a Git::Log object with count commits
def log(count = 30)
Git::Log.new(self, count)
end
# returns a Git::Status object
def status
Git::Status.new(self)
end
# returns a Git::Branches object of all the Git::Branch objects for this repo
def branches
Git::Branches.new(self)
end
# returns a Git::Branch object for branch_name
def branch(branch_name = 'master')
Git::Branch.new(self, branch_name)
end
# returns +true+ if the branch exists locally
def is_local_branch?(branch)
branch_names = self.branches.local.map {|b| b.name}
branch_names.include?(branch)
end
# returns +true+ if the branch exists remotely
def is_remote_branch?(branch)
branch_names = self.branches.local.map {|b| b.name}
branch_names.include?(branch)
end
# returns +true+ if the branch exists
def is_branch?(branch)
branch_names = self.branches.map {|b| b.name}
branch_names.include?(branch)
end
# returns a Git::Remote object
def remote(remote_name = 'origin')
Git::Remote.new(self, remote_name)
end
# this is a convenience method for accessing the class that wraps all the
# actual 'git' forked system calls. At some point I hope to replace the Git::Lib
# class with one that uses native methods or libgit C bindings
def lib
@lib ||= Git::Lib.new(self, @logger)
end
# will run a grep for 'string' on the HEAD of the git repository
#
# to be more surgical in your grep, you can call grep() off a specific
# git object. for example:
#
# @git.object("v2.3").grep('TODO')
#
# in any case, it returns a hash of arrays of the type:
# hsh[tree-ish] = [[line_no, match], [line_no, match2]]
# hsh[tree-ish] = [[line_no, match], [line_no, match2]]
#
# so you might use it like this:
#
# @git.grep("TODO").each do |sha, arr|
# puts "in blob #{sha}:"
# arr.each do |match|
# puts "\t line #{match[0]}: '#{match[1]}'"
# end
# end
def grep(string, path_limiter = nil, opts = {})
self.object('HEAD').grep(string, path_limiter, opts)
end
# returns a Git::Diff object
def diff(objectish = 'HEAD', obj2 = nil)
Git::Diff.new(self, objectish, obj2)
end
# updates the repository index using the workig dorectory content
#
# @git.add('path/to/file')
# @git.add(['path/to/file1','path/to/file2'])
# @git.add(:all => true)
#
# options:
# :all => true
#
# @param [String,Array] paths files paths to be added (optional, default='.')
# @param [Hash] options
def add(*args)
if args[0].instance_of?(String) || args[0].instance_of?(Array)
self.lib.add(args[0],args[1]||{})
else
self.lib.add('.', args[0]||{})
end
end
# removes file(s) from the git repository
def remove(path = '.', opts = {})
self.lib.remove(path, opts)
end
# resets the working directory to the provided commitish
def reset(commitish = nil, opts = {})
self.lib.reset(commitish, opts)
end
# resets the working directory to the commitish with '--hard'
def reset_hard(commitish = nil, opts = {})
opts = {:hard => true}.merge(opts)
self.lib.reset(commitish, opts)
end
# cleans the working directory
#
# options:
# :force
# :d
#
def clean(opts = {})
self.lib.clean(opts)
end
# reverts the working directory to the provided commitish.
# Accepts a range, such as comittish..HEAD
#
# options:
# :no_edit
#
def revert(commitish = nil, opts = {})
self.lib.revert(commitish, opts)
end
# commits all pending changes in the index file to the git repository
#
# options:
# :all
# :allow_empty
# :amend
# :author
#
def commit(message, opts = {})
self.lib.commit(message, opts)
end
# commits all pending changes in the index file to the git repository,
# but automatically adds all modified files without having to explicitly
# calling @git.add() on them.
def commit_all(message, opts = {})
opts = {:add_all => true}.merge(opts)
self.lib.commit(message, opts)
end
# checks out a branch as the new git working directory
def checkout(branch = 'master', opts = {})
self.lib.checkout(branch, opts)
end
# checks out an old version of a file
def checkout_file(version, file)
self.lib.checkout_file(version,file)
end
# fetches changes from a remote branch - this does not modify the working directory,
# it just gets the changes from the remote if there are any
def fetch(remote = 'origin', opts={})
self.lib.fetch(remote, opts)
end
# pushes changes to a remote repository - easiest if this is a cloned repository,
# otherwise you may have to run something like this first to setup the push parameters:
#
# @git.config('remote.remote-name.push', 'refs/heads/master:refs/heads/master')
#
def push(remote = 'origin', branch = 'master', opts = {})
# Small hack to keep backwards compatibility with the 'push(remote, branch, tags)' method signature.
opts = {:tags => opts} if [true, false].include?(opts)
self.lib.push(remote, branch, opts)
end
# merges one or more branches into the current working branch
#
# you can specify more than one branch to merge by passing an array of branches
def merge(branch, message = 'merge')
self.lib.merge(branch, message)
end
# iterates over the files which are unmerged
def each_conflict(&block) # :yields: file, your_version, their_version
self.lib.conflicts(&block)
end
# pulls the given branch from the given remote into the current branch
#
# @git.pull # pulls from origin/master
# @git.pull('upstream') # pulls from upstream/master
# @git.pull('upstream', 'develope') # pulls from upstream/develop
#
def pull(remote='origin', branch='master')
self.lib.pull(remote, branch)
end
# returns an array of Git:Remote objects
def remotes
self.lib.remotes.map { |r| Git::Remote.new(self, r) }
end
# adds a new remote to this repository
# url can be a git url or a Git::Base object if it's a local reference
#
# @git.add_remote('scotts_git', 'git://repo.or.cz/rubygit.git')
# @git.fetch('scotts_git')
# @git.merge('scotts_git/master')
#
# Options:
# :fetch => true
# :track =>
def add_remote(name, url, opts = {})
url = url.repo.path if url.is_a?(Git::Base)
self.lib.remote_add(name, url, opts)
Git::Remote.new(self, name)
end
# removes a remote from this repository
#
# @git.remove_remote('scott_git')
def remove_remote(name)
self.lib.remote_remove(name)
end
# returns an array of all Git::Tag objects for this repository
def tags
self.lib.tags.map { |r| tag(r) }
end
# returns a Git::Tag object
def tag(tag_name)
Git::Object.new(self, tag_name, 'tag', true)
end
# Creates a new git tag (Git::Tag)
# Usage:
# repo.add_tag('tag_name', object_reference)
# repo.add_tag('tag_name', object_reference, {:options => 'here'})
# repo.add_tag('tag_name', {:options => 'here'})
#
# Options:
# :a | :annotate -> true
# :d -> true
# :f -> true
# :m | :message -> String
# :s -> true
#
def add_tag(name, *opts)
self.lib.tag(name, *opts)
tag(name)
end
# deletes a tag
def delete_tag(name)
self.lib.tag(name, {:d => true})
end
# creates an archive file of the given tree-ish
def archive(treeish, file = nil, opts = {})
self.object(treeish).archive(file, opts)
end
# repacks the repository
def repack
self.lib.repack
end
def gc
self.lib.gc
end
def apply(file)
if File.exist?(file)
self.lib.apply(file)
end
end
def apply_mail(file)
self.lib.apply_mail(file) if File.exist?(file)
end
## LOWER LEVEL INDEX OPERATIONS ##
def with_index(new_index) # :yields: new_index
old_index = @index
set_index(new_index, false)
return_value = yield @index
set_index(old_index)
return_value
end
def with_temp_index &blk
# Workaround for JRUBY, since they handle the TempFile path different.
# MUST be improved to be safer and OS independent.
if RUBY_PLATFORM == 'java'
temp_path = "/tmp/temp-index-#{(0...15).map{ ('a'..'z').to_a[rand(26)] }.join}"
else
tempfile = Tempfile.new('temp-index')
temp_path = tempfile.path
tempfile.close
tempfile.unlink
end
with_index(temp_path, &blk)
end
def checkout_index(opts = {})
self.lib.checkout_index(opts)
end
def read_tree(treeish, opts = {})
self.lib.read_tree(treeish, opts)
end
def write_tree
self.lib.write_tree
end
def commit_tree(tree = nil, opts = {})
Git::Object::Commit.new(self, self.lib.commit_tree(tree, opts))
end
def write_and_commit_tree(opts = {})
tree = write_tree
commit_tree(tree, opts)
end
def update_ref(branch, commit)
branch(branch).update_ref(commit)
end
def ls_files(location=nil)
self.lib.ls_files(location)
end
def with_working(work_dir) # :yields: the Git::WorkingDirectory
return_value = false
old_working = @working_directory
set_working(work_dir)
Dir.chdir work_dir do
return_value = yield @working_directory
end
set_working(old_working)
return_value
end
def with_temp_working &blk
tempfile = Tempfile.new("temp-workdir")
temp_dir = tempfile.path
tempfile.close
tempfile.unlink
Dir.mkdir(temp_dir, 0700)
with_working(temp_dir, &blk)
end
# runs git rev-parse to convert the objectish to a full sha
#
# @git.revparse("HEAD^^")
# @git.revparse('v2.4^{tree}')
# @git.revparse('v2.4:/doc/index.html')
#
def revparse(objectish)
self.lib.revparse(objectish)
end
def ls_tree(objectish)
self.lib.ls_tree(objectish)
end
def cat_file(objectish)
self.lib.object_contents(objectish)
end
# returns the name of the branch the working directory is currently on
def current_branch
self.lib.branch_current
end
end
end
ruby-git-1.2.8/lib/git/branch.rb 0000664 0000000 0000000 00000005301 12366517705 0016412 0 ustar 00root root 0000000 0000000 require 'git/path'
module Git
class Branch < Path
attr_accessor :full, :remote, :name
def initialize(base, name)
@full = name
@base = base
@gcommit = nil
@stashes = nil
@remote, @name = parse_name(name)
end
def gcommit
@gcommit ||= @base.gcommit(@full)
@gcommit
end
def stashes
@stashes ||= Git::Stashes.new(@base)
end
def checkout
check_if_create
@base.checkout(@full)
end
def archive(file, opts = {})
@base.lib.archive(@full, file, opts)
end
# g.branch('new_branch').in_branch do
# # create new file
# # do other stuff
# return true # auto commits and switches back
# end
def in_branch (message = 'in branch work')
old_current = @base.lib.branch_current
checkout
if yield
@base.commit_all(message)
else
@base.reset_hard
end
@base.checkout(old_current)
end
def create
check_if_create
end
def delete
@base.lib.branch_delete(@name)
end
def current
determine_current
end
def merge(branch = nil, message = nil)
if branch
in_branch do
@base.merge(branch, message)
false
end
# merge a branch into this one
else
# merge this branch into the current one
@base.merge(@name)
end
end
def update_ref(commit)
@base.lib.update_ref(@full, commit)
end
def to_a
[@full]
end
def to_s
@full
end
private
def check_if_create
@base.lib.branch_new(@name) rescue nil
end
def determine_current
@base.lib.branch_current == @name
end
# Given a full branch name return an Array containing the remote and branch names.
#
# Removes 'remotes' from the beggining of the name (if present).
# Takes the second part (splittign by '/') as the remote name.
# Takes the rest as the repo name (can also hold one or more '/').
#
# Example:
# parse_name('master') #=> [nil, 'master']
# parse_name('origin/master') #=> ['origin', 'master']
# parse_name('remotes/origin/master') #=> ['origin', 'master']
# parse_name('origin/master/v2') #=> ['origin', 'master/v2']
#
# param [String] name branch full name.
# return [] an Array containing the remote and branch names.
def parse_name(name)
if name.match(/^(?:remotes)?\/([^\/]+)\/(.+)/)
return [Git::Remote.new(@base, $1), $2]
end
return [nil, name]
end
end
end
ruby-git-1.2.8/lib/git/branches.rb 0000664 0000000 0000000 00000003171 12366517705 0016745 0 ustar 00root root 0000000 0000000 module Git
# object that holds all the available branches
class Branches
include Enumerable
def initialize(base)
@branches = {}
@base = base
@base.lib.branches_all.each do |b|
@branches[b[0]] = Git::Branch.new(@base, b[0])
end
end
def local
self.select { |b| !b.remote }
end
def remote
self.select { |b| b.remote }
end
# array like methods
def size
@branches.size
end
def each(&block)
@branches.values.each(&block)
end
# Returns the target branch
#
# Example:
# Given (git branch -a):
# master
# remotes/working/master
#
# g.branches['master'].full #=> 'master'
# g.branches['working/master'].full => 'remotes/working/master'
# g.branches['remotes/working/master'].full => 'remotes/working/master'
#
# @param [#to_s] branch_name the target branch name.
# @return [Git::Branch] the target branch.
def [](branch_name)
@branches.values.inject(@branches) do |branches, branch|
branches[branch.full] ||= branch
# This is how Git (version 1.7.9.5) works.
# Lets you ignore the 'remotes' if its at the beginning of the branch full name (even if is not a real remote branch).
branches[branch.full.sub('remotes/', '')] ||= branch if branch.full =~ /^remotes\/.+/
branches
end[branch_name.to_s]
end
def to_s
out = ''
@branches.each do |k, b|
out << (b.current ? '* ' : ' ') << b.to_s << "\n"
end
out
end
end
end
ruby-git-1.2.8/lib/git/diff.rb 0000664 0000000 0000000 00000006604 12366517705 0016074 0 ustar 00root root 0000000 0000000 module Git
# object that holds the last X commits on given branch
class Diff
include Enumerable
def initialize(base, from = nil, to = nil)
@base = base
@from = from.to_s
@to = to.to_s
@path = nil
@full_diff = nil
@full_diff_files = nil
@stats = nil
end
attr_reader :from, :to
def path(path)
@path = path
return self
end
def size
cache_stats
@stats[:total][:files]
end
def lines
cache_stats
@stats[:total][:lines]
end
def deletions
cache_stats
@stats[:total][:deletions]
end
def insertions
cache_stats
@stats[:total][:insertions]
end
def stats
cache_stats
@stats
end
# if file is provided and is writable, it will write the patch into the file
def patch(file = nil)
cache_full
@full_diff
end
alias_method :to_s, :patch
# enumerable methods
def [](key)
process_full
@full_diff_files.assoc(key)[1]
end
def each(&block) # :yields: each Git::DiffFile in turn
process_full
@full_diff_files.map { |file| file[1] }.each(&block)
end
class DiffFile
attr_accessor :patch, :path, :mode, :src, :dst, :type
@base = nil
def initialize(base, hash)
@base = base
@patch = hash[:patch]
@path = hash[:path]
@mode = hash[:mode]
@src = hash[:src]
@dst = hash[:dst]
@type = hash[:type]
@binary = hash[:binary]
end
def binary?
!!@binary
end
def blob(type = :dst)
if type == :src
@base.object(@src) if @src != '0000000'
else
@base.object(@dst) if @dst != '0000000'
end
end
end
private
def cache_full
unless @full_diff
@full_diff = @base.lib.diff_full(@from, @to, {:path_limiter => @path})
end
end
def process_full
unless @full_diff_files
cache_full
@full_diff_files = process_full_diff
end
end
def cache_stats
unless @stats
@stats = @base.lib.diff_stats(@from, @to, {:path_limiter => @path})
end
end
# break up @diff_full
def process_full_diff
final = {}
current_file = nil
@full_diff.split("\n").each do |line|
if m = /diff --git a\/(.*?) b\/(.*?)/.match(line)
current_file = m[1]
final[current_file] = {:patch => line, :path => current_file,
:mode => '', :src => '', :dst => '', :type => 'modified'}
else
if m = /index (.......)\.\.(.......)( ......)*/.match(line)
final[current_file][:src] = m[1]
final[current_file][:dst] = m[2]
final[current_file][:mode] = m[3].strip if m[3]
end
if m = /(.*?) file mode (......)/.match(line)
final[current_file][:type] = m[1]
final[current_file][:mode] = m[2]
end
if m = /^Binary files /.match(line)
final[current_file][:binary] = true
end
final[current_file][:patch] << "\n" + line
end
end
final.map { |e| [e[0], DiffFile.new(@base, e[1])] }
end
end
end
ruby-git-1.2.8/lib/git/index.rb 0000664 0000000 0000000 00000000064 12366517705 0016265 0 ustar 00root root 0000000 0000000 module Git
class Index < Git::Path
end
end
ruby-git-1.2.8/lib/git/lib.rb 0000664 0000000 0000000 00000053533 12366517705 0015735 0 ustar 00root root 0000000 0000000 require 'tempfile'
module Git
class GitExecuteError < StandardError
end
class Lib
def initialize(base = nil, logger = nil)
@git_dir = nil
@git_index_file = nil
@git_work_dir = nil
@path = nil
if base.is_a?(Git::Base)
@git_dir = base.repo.path
@git_index_file = base.index.path if base.index
@git_work_dir = base.dir.path if base.dir
elsif base.is_a?(Hash)
@git_dir = base[:repository]
@git_index_file = base[:index]
@git_work_dir = base[:working_directory]
end
@logger = logger
end
# creates or reinitializes the repository
#
# options:
# :bare
# :working_directory
#
def init(opts={})
arr_opts = []
arr_opts << '--bare' if opts[:bare]
command('init', arr_opts, false)
end
# tries to clone the given repo
#
# returns {:repository} (if bare)
# {:working_directory} otherwise
#
# accepts options:
# :remote:: name of remote (rather than 'origin')
# :bare:: no working directory
# :recursive:: after the clone is created, initialize all submodules within, using their default settings.
# :depth:: the number of commits back to pull
#
# TODO - make this work with SSH password or auth_key
#
def clone(repository, name, opts = {})
@path = opts[:path] || '.'
clone_dir = opts[:path] ? File.join(@path, name) : name
arr_opts = []
arr_opts << "--bare" if opts[:bare]
arr_opts << "--recursive" if opts[:recursive]
arr_opts << "-o" << opts[:remote] if opts[:remote]
arr_opts << "--depth" << opts[:depth].to_i if opts[:depth] && opts[:depth].to_i > 0
arr_opts << "--config" << opts[:config] if opts[:config]
arr_opts << '--'
arr_opts << repository
arr_opts << clone_dir
command('clone', arr_opts)
opts[:bare] ? {:repository => clone_dir} : {:working_directory => clone_dir}
end
## READ COMMANDS ##
def log_commits(opts={})
arr_opts = log_common_options(opts)
arr_opts << '--pretty=oneline'
arr_opts += log_path_options(opts)
command_lines('log', arr_opts, true).map { |l| l.split.first }
end
def full_log_commits(opts={})
arr_opts = log_common_options(opts)
arr_opts << '--pretty=raw'
arr_opts << "--skip=#{opts[:skip]}" if opts[:skip]
arr_opts += log_path_options(opts)
full_log = command_lines('log', arr_opts, true)
process_commit_log_data(full_log)
end
def revparse(string)
return string if string =~ /^[A-Fa-f0-9]{40}$/ # passing in a sha - just no-op it
rev = ['head', 'remotes', 'tags'].map do |d|
File.join(@git_dir, 'refs', d, string)
end.find do |path|
File.file?(path)
end
return File.read(rev).chomp if rev
command('rev-parse', string)
end
def namerev(string)
command('name-rev', string).split[1]
end
def object_type(sha)
command('cat-file', ['-t', sha])
end
def object_size(sha)
command('cat-file', ['-s', sha]).to_i
end
# returns useful array of raw commit object data
def commit_data(sha)
sha = sha.to_s
cdata = command_lines('cat-file', ['commit', sha])
process_commit_data(cdata, sha, 0)
end
def process_commit_data(data, sha = nil, indent = 4)
hsh = {
'sha' => sha,
'message' => '',
'parent' => []
}
loop do
key, *value = data.shift.split
break if key.nil?
if key == 'parent'
hsh['parent'] << value.join(' ')
else
hsh[key] = value.join(' ')
end
end
hsh['message'] = data.collect {|line| line[indent..-1]}.join("\n") + "\n"
return hsh
end
def process_commit_log_data(data)
in_message = false
hsh_array = []
hsh = nil
data.each do |line|
line = line.chomp
if line[0].nil?
in_message = !in_message
next
end
if in_message
hsh['message'] << "#{line[4..-1]}\n"
next
end
key, *value = line.split
value = value.join(' ')
case key
when 'commit'
hsh_array << hsh if hsh
hsh = {'sha' => value, 'message' => '', 'parent' => []}
when 'parent'
hsh['parent'] << value
else
hsh[key] = value
end
end
hsh_array << hsh if hsh
return hsh_array
end
def object_contents(sha, &block)
command('cat-file', ['-p', sha], &block)
end
def ls_tree(sha)
data = {'blob' => {}, 'tree' => {}}
command_lines('ls-tree', sha).each do |line|
(info, filenm) = line.split("\t")
(mode, type, sha) = info.split
data[type][filenm] = {:mode => mode, :sha => sha}
end
data
end
def mv(file1, file2)
command_lines('mv', ['--', file1, file2])
end
def full_tree(sha)
command_lines('ls-tree', ['-r', sha])
end
def tree_depth(sha)
full_tree(sha).size
end
def change_head_branch(branch_name)
command('symbolic-ref', ['HEAD', "refs/heads/#{branch_name}"])
end
def branches_all
arr = []
command_lines('branch', '-a').each do |b|
current = (b[0, 2] == '* ')
arr << [b.gsub('* ', '').strip, current]
end
arr
end
def list_files(ref_dir)
dir = File.join(@git_dir, 'refs', ref_dir)
files = []
Dir.chdir(dir) { files = Dir.glob('**/*').select { |f| File.file?(f) } } rescue nil
files
end
def branch_current
branches_all.select { |b| b[1] }.first[0] rescue nil
end
# returns hash
# [tree-ish] = [[line_no, match], [line_no, match2]]
# [tree-ish] = [[line_no, match], [line_no, match2]]
def grep(string, opts = {})
opts[:object] ||= 'HEAD'
grep_opts = ['-n']
grep_opts << '-i' if opts[:ignore_case]
grep_opts << '-v' if opts[:invert_match]
grep_opts << '-e'
grep_opts << string
grep_opts << opts[:object] if opts[:object].is_a?(String)
grep_opts << '--' << opts[:path_limiter] if opts[:path_limiter].is_a? String
hsh = {}
command_lines('grep', grep_opts).each do |line|
if m = /(.*)\:(\d+)\:(.*)/.match(line)
hsh[m[1]] ||= []
hsh[m[1]] << [m[2].to_i, m[3]]
end
end
hsh
end
def diff_full(obj1 = 'HEAD', obj2 = nil, opts = {})
diff_opts = ['-p']
diff_opts << obj1
diff_opts << obj2 if obj2.is_a?(String)
diff_opts << '--' << opts[:path_limiter] if opts[:path_limiter].is_a? String
command('diff', diff_opts)
end
def diff_stats(obj1 = 'HEAD', obj2 = nil, opts = {})
diff_opts = ['--numstat']
diff_opts << obj1
diff_opts << obj2 if obj2.is_a?(String)
diff_opts << '--' << opts[:path_limiter] if opts[:path_limiter].is_a? String
hsh = {:total => {:insertions => 0, :deletions => 0, :lines => 0, :files => 0}, :files => {}}
command_lines('diff', diff_opts).each do |file|
(insertions, deletions, filename) = file.split("\t")
hsh[:total][:insertions] += insertions.to_i
hsh[:total][:deletions] += deletions.to_i
hsh[:total][:lines] = (hsh[:total][:deletions] + hsh[:total][:insertions])
hsh[:total][:files] += 1
hsh[:files][filename] = {:insertions => insertions.to_i, :deletions => deletions.to_i}
end
hsh
end
# compares the index and the working directory
def diff_files
diff_as_hash('diff-files')
end
# compares the index and the repository
def diff_index(treeish)
diff_as_hash('diff-index', treeish)
end
def ls_files(location=nil)
hsh = {}
command_lines('ls-files', ['--stage', location]).each do |line|
(info, file) = line.split("\t")
(mode, sha, stage) = info.split
file = eval(file) if file =~ /^\".*\"$/ # This takes care of quoted strings returned from git
hsh[file] = {:path => file, :mode_index => mode, :sha_index => sha, :stage => stage}
end
hsh
end
def ignored_files
command_lines('ls-files', ['--others', '-i', '--exclude-standard'])
end
def config_remote(name)
hsh = {}
config_list.each do |key, value|
if /remote.#{name}/.match(key)
hsh[key.gsub("remote.#{name}.", '')] = value
end
end
hsh
end
def config_get(name)
do_get = lambda do |path|
command('config', ['--get', name])
end
if @git_dir
Dir.chdir(@git_dir, &do_get)
else
build_list.call
end
end
def global_config_get(name)
command('config', ['--global', '--get', name], false)
end
def config_list
build_list = lambda do |path|
parse_config_list command_lines('config', ['--list'])
end
if @git_dir
Dir.chdir(@git_dir, &build_list)
else
build_list.call
end
end
def global_config_list
parse_config_list command_lines('config', ['--global', '--list'], false)
end
def parse_config_list(lines)
hsh = {}
lines.each do |line|
(key, *values) = line.split('=')
hsh[key] = values.join('=')
end
hsh
end
def parse_config(file)
parse_config_list command_lines('config', ['--list', '--file', file], false)
end
## WRITE COMMANDS ##
def config_set(name, value)
command('config', [name, value])
end
def global_config_set(name, value)
command('config', ['--global', name, value], false)
end
# updates the repository index using the workig dorectory content
#
# lib.add('path/to/file')
# lib.add(['path/to/file1','path/to/file2'])
# lib.add(:all => true)
#
# options:
# :all => true
# :force => true
#
# @param [String,Array] paths files paths to be added to the repository
# @param [Hash] options
def add(paths='.',options={})
arr_opts = []
arr_opts << '--all' if options[:all]
arr_opts << '--force' if options[:force]
arr_opts << '--'
arr_opts << paths
arr_opts.flatten!
command('add', arr_opts)
end
def remove(path = '.', opts = {})
arr_opts = ['-f'] # overrides the up-to-date check by default
arr_opts << ['-r'] if opts[:recursive]
arr_opts << '--'
if path.is_a?(Array)
arr_opts += path
else
arr_opts << path
end
command('rm', arr_opts)
end
def commit(message, opts = {})
arr_opts = []
arr_opts << "--message=#{message}" if message
arr_opts << '--amend' << '--no-edit' if opts[:amend]
arr_opts << '--all' if opts[:add_all] || opts[:all]
arr_opts << '--allow-empty' if opts[:allow_empty]
arr_opts << "--author=#{opts[:author]}" if opts[:author]
command('commit', arr_opts)
end
def reset(commit, opts = {})
arr_opts = []
arr_opts << '--hard' if opts[:hard]
arr_opts << commit if commit
command('reset', arr_opts)
end
def clean(opts = {})
arr_opts = []
arr_opts << '--force' if opts[:force]
arr_opts << '-d' if opts[:d]
arr_opts << '-x' if opts[:x]
command('clean', arr_opts)
end
def revert(commitish, opts = {})
# Forcing --no-edit as default since it's not an interactive session.
opts = {:no_edit => true}.merge(opts)
arr_opts = []
arr_opts << '--no-edit' if opts[:no_edit]
arr_opts << commitish
command('revert', arr_opts)
end
def apply(patch_file)
arr_opts = []
arr_opts << '--' << patch_file if patch_file
command('apply', arr_opts)
end
def apply_mail(patch_file)
arr_opts = []
arr_opts << '--' << patch_file if patch_file
command('am', arr_opts)
end
def stashes_all
arr = []
filename = File.join(@git_dir, 'logs/refs/stash')
if File.exist?(filename)
File.open(filename).each_with_index { |line, i|
m = line.match(/:(.*)$/)
arr << [i, m[1].strip]
}
end
arr
end
def stash_save(message)
output = command('stash save', ['--', message])
output =~ /HEAD is now at/
end
def stash_apply(id = nil)
if id
command('stash apply', [id])
else
command('stash apply')
end
end
def stash_clear
command('stash clear')
end
def stash_list
command('stash list')
end
def branch_new(branch)
command('branch', branch)
end
def branch_delete(branch)
command('branch', ['-D', branch])
end
def checkout(branch, opts = {})
arr_opts = []
arr_opts << '-f' if opts[:force]
arr_opts << '-b' << opts[:new_branch] if opts[:new_branch]
arr_opts << branch
command('checkout', arr_opts)
end
def checkout_file(version, file)
arr_opts = []
arr_opts << version
arr_opts << file
command('checkout', arr_opts)
end
def merge(branch, message = nil)
arr_opts = []
arr_opts << '-m' << message if message
arr_opts += [branch]
command('merge', arr_opts)
end
def unmerged
unmerged = []
command_lines('diff', ["--cached"]).each do |line|
unmerged << $1 if line =~ /^\* Unmerged path (.*)/
end
unmerged
end
def conflicts # :yields: file, your, their
self.unmerged.each do |f|
your = Tempfile.new("YOUR-#{File.basename(f)}").path
command('show', ":2:#{f}", true, "> #{escape your}")
their = Tempfile.new("THEIR-#{File.basename(f)}").path
command('show', ":3:#{f}", true, "> #{escape their}")
yield(f, your, their)
end
end
def remote_add(name, url, opts = {})
arr_opts = ['add']
arr_opts << '-f' if opts[:with_fetch] || opts[:fetch]
arr_opts << '-t' << opts[:track] if opts[:track]
arr_opts << '--'
arr_opts << name
arr_opts << url
command('remote', arr_opts)
end
def remote_remove(name)
command('remote', ['rm', name])
end
def remotes
command_lines('remote')
end
def tags
command_lines('tag')
end
def tag(name, *opts)
target = opts[0].instance_of?(String) ? opts[0] : nil
opts = opts.last.instance_of?(Hash) ? opts.last : {}
if (opts[:a] || opts[:annotate]) && !(opts[:m] || opts[:message])
raise "Can not create an [:a|:annotate] tag without the precense of [:m|:message]."
end
arr_opts = []
arr_opts << '-f' if opts[:force] || opts[:f]
arr_opts << '-a' if opts[:a] || opts[:annotate]
arr_opts << '-s' if opts[:s] || opts[:sign]
arr_opts << '-d' if opts[:d] || opts[:delete]
arr_opts << name
arr_opts << target if target
arr_opts << "-m #{opts[:m] || opts[:message]}" if opts[:m] || opts[:message]
command('tag', arr_opts)
end
def fetch(remote, opts)
arr_opts = [remote]
arr_opts << '--tags' if opts[:t] || opts[:tags]
command('fetch', arr_opts)
end
def push(remote, branch = 'master', opts = {})
# Small hack to keep backwards compatibility with the 'push(remote, branch, tags)' method signature.
opts = {:tags => opts} if [true, false].include?(opts)
arr_opts = []
arr_opts << '--force' if opts[:force] || opts[:f]
arr_opts << remote
command('push', arr_opts + [branch])
command('push', ['--tags'] + arr_opts) if opts[:tags]
end
def pull(remote='origin', branch='master')
command('pull', [remote, branch])
end
def tag_sha(tag_name)
head = File.join(@git_dir, 'refs', 'tags', tag_name)
return File.read(head).chomp if File.exist?(head)
command('show-ref', ['--tags', '-s', tag_name])
end
def repack
command('repack', ['-a', '-d'])
end
def gc
command('gc', ['--prune', '--aggressive', '--auto'])
end
# reads a tree into the current index file
def read_tree(treeish, opts = {})
arr_opts = []
arr_opts << "--prefix=#{opts[:prefix]}" if opts[:prefix]
arr_opts += [treeish]
command('read-tree', arr_opts)
end
def write_tree
command('write-tree')
end
def commit_tree(tree, opts = {})
opts[:message] ||= "commit tree #{tree}"
t = Tempfile.new('commit-message')
t.write(opts[:message])
t.close
arr_opts = []
arr_opts << tree
arr_opts << '-p' << opts[:parent] if opts[:parent]
arr_opts += [opts[:parents]].map { |p| ['-p', p] }.flatten if opts[:parents]
command('commit-tree', arr_opts, true, "< #{escape t.path}")
end
def update_ref(branch, commit)
command('update-ref', [branch, commit])
end
def checkout_index(opts = {})
arr_opts = []
arr_opts << "--prefix=#{opts[:prefix]}" if opts[:prefix]
arr_opts << "--force" if opts[:force]
arr_opts << "--all" if opts[:all]
arr_opts << '--' << opts[:path_limiter] if opts[:path_limiter].is_a? String
command('checkout-index', arr_opts)
end
# creates an archive file
#
# options
# :format (zip, tar)
# :prefix
# :remote
# :path
def archive(sha, file = nil, opts = {})
opts[:format] ||= 'zip'
if opts[:format] == 'tgz'
opts[:format] = 'tar'
opts[:add_gzip] = true
end
file ||= Tempfile.new('archive').path
arr_opts = []
arr_opts << "--format=#{opts[:format]}" if opts[:format]
arr_opts << "--prefix=#{opts[:prefix]}" if opts[:prefix]
arr_opts << "--remote=#{opts[:remote]}" if opts[:remote]
arr_opts << sha
arr_opts << '--' << opts[:path] if opts[:path]
command('archive', arr_opts, true, (opts[:add_gzip] ? '| gzip' : '') + " > #{escape file}")
return file
end
# returns the current version of git, as an Array of Fixnums.
def current_command_version
output = command('version', [], false)
version = output[/\d+\.\d+(\.\d+)+/]
version.split('.').collect {|i| i.to_i}
end
def required_command_version
[1, 6]
end
def meets_required_version?
(self.current_command_version <=> self.required_command_version) >= 0
end
private
def command_lines(cmd, opts = [], chdir = true, redirect = '')
command(cmd, opts, chdir).split("\n")
end
def command(cmd, opts = [], chdir = true, redirect = '', &block)
ENV['GIT_DIR'] = @git_dir
ENV['GIT_WORK_TREE'] = @git_work_dir
ENV['GIT_INDEX_FILE'] = @git_index_file
path = @git_work_dir || @git_dir || @path
opts = [opts].flatten.map {|s| escape(s) }.join(' ')
git_cmd = "git #{cmd} #{opts} #{redirect} 2>&1"
out = nil
if chdir && (Dir.getwd != path)
Dir.chdir(path) { out = run_command(git_cmd, &block) }
else
out = run_command(git_cmd, &block)
end
if @logger
@logger.info(git_cmd)
@logger.debug(out)
end
if $?.exitstatus > 0
if $?.exitstatus == 1 && out == ''
return ''
end
raise Git::GitExecuteError.new(git_cmd + ':' + out.to_s)
end
out
end
# Takes the diff command line output (as Array) and parse it into a Hash
#
# @param [String] diff_command the diff commadn to be used
# @param [Array] opts the diff options to be used
# @return [Hash] the diff as Hash
def diff_as_hash(diff_command, opts=[])
command_lines(diff_command, opts).inject({}) do |memo, line|
info, file = line.split("\t")
mode_src, mode_dest, sha_src, sha_dest, type = info.split
memo[file] = {
:mode_index => mode_dest,
:mode_repo => mode_src.to_s[1, 7],
:path => file,
:sha_repo => sha_src,
:sha_index => sha_dest,
:type => type
}
memo
end
end
# Returns an array holding the common options for the log commands
#
# @param [Hash] opts the given options
# @return [Array] the set of common options that the log command will use
def log_common_options(opts)
arr_opts = []
arr_opts << "-#{opts[:count]}" if opts[:count]
arr_opts << "--no-color"
arr_opts << "--since=#{opts[:since]}" if opts[:since].is_a? String
arr_opts << "--until=#{opts[:until]}" if opts[:until].is_a? String
arr_opts << "--grep=#{opts[:grep]}" if opts[:grep].is_a? String
arr_opts << "--author=#{opts[:author]}" if opts[:author].is_a? String
arr_opts << "#{opts[:between][0].to_s}..#{opts[:between][1].to_s}" if (opts[:between] && opts[:between].size == 2)
arr_opts
end
# Retrurns an array holding path options for the log commands
#
# @param [Hash] opts the given options
# @return [Array] the set of path options that the log command will use
def log_path_options(opts)
arr_opts = []
arr_opts << opts[:object] if opts[:object].is_a? String
arr_opts << '--' << opts[:path_limiter] if opts[:path_limiter]
arr_opts
end
def run_command(git_cmd, &block)
if block_given?
IO.popen(git_cmd, &block)
else
`#{git_cmd}`.chomp
end
end
def escape(s)
return "'#{s && s.to_s.gsub('\'','\'"\'"\'')}'" if RUBY_PLATFORM !~ /mingw|mswin/
# Keeping the old escape format for windows users
escaped = s.to_s.gsub('\'', '\'\\\'\'')
return %Q{"#{escaped}"}
end
end
end
ruby-git-1.2.8/lib/git/log.rb 0000664 0000000 0000000 00000004365 12366517705 0015747 0 ustar 00root root 0000000 0000000 module Git
# object that holds the last X commits on given branch
class Log
include Enumerable
def initialize(base, count = 30)
dirty_log
@base = base
@count = count
@commits = nil
@author = nil
@grep = nil
@object = nil
@path = nil
@since = nil
@skip = nil
@until = nil
@between = nil
end
def object(objectish)
dirty_log
@object = objectish
return self
end
def author(regex)
dirty_log
@author = regex
return self
end
def grep(regex)
dirty_log
@grep = regex
return self
end
def path(path)
dirty_log
@path = path
return self
end
def skip(num)
dirty_log
@skip = num
return self
end
def since(date)
dirty_log
@since = date
return self
end
def until(date)
dirty_log
@until = date
return self
end
def between(sha1, sha2 = nil)
dirty_log
@between = [sha1, sha2]
return self
end
def to_s
self.map { |c| c.to_s }.join("\n")
end
# forces git log to run
def size
check_log
@commits.size rescue nil
end
def each(&block)
check_log
@commits.each(&block)
end
def first
check_log
@commits.first rescue nil
end
def last
check_log
@commits.last rescue nil
end
def [](index)
check_log
@commits[index] rescue nil
end
private
def dirty_log
@dirty_flag = true
end
def check_log
if @dirty_flag
run_log
@dirty_flag = false
end
end
# actually run the 'git log' command
def run_log
log = @base.lib.full_log_commits(:count => @count, :object => @object,
:path_limiter => @path, :since => @since,
:author => @author, :grep => @grep, :skip => @skip,
:until => @until, :between => @between)
@commits = log.map { |c| Git::Object::Commit.new(@base, c['sha'], c) }
end
end
end
ruby-git-1.2.8/lib/git/object.rb 0000664 0000000 0000000 00000013711 12366517705 0016427 0 ustar 00root root 0000000 0000000 module Git
class GitTagNameDoesNotExist< StandardError
end
# represents a git object
class Object
class AbstractObject
attr_accessor :objectish, :type, :mode
attr_writer :size
def initialize(base, objectish)
@base = base
@objectish = objectish.to_s
@contents = nil
@trees = nil
@size = nil
@sha = nil
end
def sha
@sha ||= @base.lib.revparse(@objectish)
end
def size
@size ||= @base.lib.object_size(@objectish)
end
# Get the object's contents.
# If no block is given, the contents are cached in memory and returned as a string.
# If a block is given, it yields an IO object (via IO::popen) which could be used to
# read a large file in chunks.
#
# Use this for large files so that they are not held in memory.
def contents(&block)
if block_given?
@base.lib.object_contents(@objectish, &block)
else
@contents ||= @base.lib.object_contents(@objectish)
end
end
def contents_array
self.contents.split("\n")
end
def to_s
@objectish
end
def grep(string, path_limiter = nil, opts = {})
opts = {:object => sha, :path_limiter => path_limiter}.merge(opts)
@base.lib.grep(string, opts)
end
def diff(objectish)
Git::Diff.new(@base, @objectish, objectish)
end
def log(count = 30)
Git::Log.new(@base, count).object(@objectish)
end
# creates an archive of this object (tree)
def archive(file = nil, opts = {})
@base.lib.archive(@objectish, file, opts)
end
def tree?; false; end
def blob?; false; end
def commit?; false; end
def tag?; false; end
end
class Blob < AbstractObject
def initialize(base, sha, mode = nil)
super(base, sha)
@mode = mode
end
def blob?
true
end
end
class Tree < AbstractObject
def initialize(base, sha, mode = nil)
super(base, sha)
@mode = mode
@trees = nil
@blobs = nil
end
def children
blobs.merge(subtrees)
end
def blobs
@blobs ||= check_tree[:blobs]
end
alias_method :files, :blobs
def trees
@trees ||= check_tree[:trees]
end
alias_method :subtrees, :trees
alias_method :subdirectories, :trees
def full_tree
@base.lib.full_tree(@objectish)
end
def depth
@base.lib.tree_depth(@objectish)
end
def tree?
true
end
private
# actually run the git command
def check_tree
@trees = {}
@blobs = {}
data = @base.lib.ls_tree(@objectish)
data['tree'].each do |key, tree|
@trees[key] = Git::Object::Tree.new(@base, tree[:sha], tree[:mode])
end
data['blob'].each do |key, blob|
@blobs[key] = Git::Object::Blob.new(@base, blob[:sha], blob[:mode])
end
{
:trees => @trees,
:blobs => @blobs
}
end
end
class Commit < AbstractObject
def initialize(base, sha, init = nil)
super(base, sha)
@tree = nil
@parents = nil
@author = nil
@committer = nil
@message = nil
if init
set_commit(init)
end
end
def message
check_commit
@message
end
def name
@base.lib.namerev(sha)
end
def gtree
check_commit
Tree.new(@base, @tree)
end
def parent
parents.first
end
# array of all parent commits
def parents
check_commit
@parents
end
# git author
def author
check_commit
@author
end
def author_date
author.date
end
# git author
def committer
check_commit
@committer
end
def committer_date
committer.date
end
alias_method :date, :committer_date
def diff_parent
diff(parent)
end
def set_commit(data)
if data['sha']
@sha = data['sha']
end
@committer = Git::Author.new(data['committer'])
@author = Git::Author.new(data['author'])
@tree = Git::Object::Tree.new(@base, data['tree'])
@parents = data['parent'].map{ |sha| Git::Object::Commit.new(@base, sha) }
@message = data['message'].chomp
end
def commit?
true
end
private
# see if this object has been initialized and do so if not
def check_commit
unless @tree
data = @base.lib.commit_data(@objectish)
set_commit(data)
end
end
end
class Tag < AbstractObject
attr_accessor :name
def initialize(base, sha, name)
super(base, sha)
@name = name
end
def tag?
true
end
end
# if we're calling this, we don't know what type it is yet
# so this is our little factory method
def self.new(base, objectish, type = nil, is_tag = false)
if is_tag
sha = base.lib.tag_sha(objectish)
if sha == ''
raise Git::GitTagNameDoesNotExist.new(objectish)
end
return Git::Object::Tag.new(base, sha, objectish)
end
type ||= base.lib.object_type(objectish)
klass =
case type
when /blob/ then Blob
when /commit/ then Commit
when /tree/ then Tree
end
klass.new(base, objectish)
end
end
end
ruby-git-1.2.8/lib/git/path.rb 0000664 0000000 0000000 00000000710 12366517705 0016110 0 ustar 00root root 0000000 0000000 module Git
class Path
attr_accessor :path
def initialize(path, check_path=true)
path = File.expand_path(path)
if check_path && !File.exist?(path)
raise ArgumentError, 'path does not exist', [path]
end
@path = path
end
def readable?
File.readable?(@path)
end
def writable?
File.writable?(@path)
end
def to_s
@path
end
end
end
ruby-git-1.2.8/lib/git/remote.rb 0000664 0000000 0000000 00000001245 12366517705 0016453 0 ustar 00root root 0000000 0000000 module Git
class Remote < Path
attr_accessor :name, :url, :fetch_opts
def initialize(base, name)
@base = base
config = @base.lib.config_remote(name)
@name = name
@url = config['url']
@fetch_opts = config['fetch']
end
def fetch(opts={})
@base.fetch(@name, opts)
end
# merge this remote locally
def merge(branch = 'master')
@base.merge("#{@name}/#{branch}")
end
def branch(branch = 'master')
Git::Branch.new(@base, "#{@name}/#{branch}")
end
def remove
@base.lib.remote_remove(@name)
end
def to_s
@name
end
end
end
ruby-git-1.2.8/lib/git/repository.rb 0000664 0000000 0000000 00000000061 12366517705 0017372 0 ustar 00root root 0000000 0000000 module Git
class Repository < Path
end
end
ruby-git-1.2.8/lib/git/stash.rb 0000664 0000000 0000000 00000000562 12366517705 0016303 0 ustar 00root root 0000000 0000000 module Git
class Stash
def initialize(base, message, existing=false)
@base = base
@message = message
save unless existing
end
def save
@saved = @base.lib.stash_save(@message)
end
def saved?
@saved
end
def message
@message
end
def to_s
message
end
end
end ruby-git-1.2.8/lib/git/stashes.rb 0000664 0000000 0000000 00000001370 12366517705 0016631 0 ustar 00root root 0000000 0000000 module Git
# object that holds all the available stashes
class Stashes
include Enumerable
def initialize(base)
@stashes = []
@base = base
@base.lib.stashes_all.each do |id, message|
@stashes.unshift(Git::Stash.new(@base, message, true))
end
end
def save(message)
s = Git::Stash.new(@base, message)
@stashes.unshift(s) if s.saved?
end
def apply(index=nil)
@base.lib.stash_apply(index)
end
def clear
@base.lib.stash_clear
@stashes = []
end
def size
@stashes.size
end
def each(&block)
@stashes.each(&block)
end
def [](index)
@stashes[index.to_i]
end
end
end
ruby-git-1.2.8/lib/git/status.rb 0000664 0000000 0000000 00000005173 12366517705 0016507 0 ustar 00root root 0000000 0000000 module Git
class Status
include Enumerable
def initialize(base)
@base = base
construct_status
end
def changed
@files.select { |k, f| f.type == 'M' }
end
def added
@files.select { |k, f| f.type == 'A' }
end
def deleted
@files.select { |k, f| f.type == 'D' }
end
def untracked
@files.select { |k, f| f.untracked }
end
def pretty
out = ''
self.each do |file|
out << pretty_file(file)
end
out << "\n"
out
end
def pretty_file(file)
< file, :untracked => true}
end
end
# find modified in tree
@base.lib.diff_files.each do |path, data|
@files[path] ? @files[path].merge!(data) : @files[path] = data
end
# find added but not committed - new files
@base.lib.diff_index('HEAD').each do |path, data|
@files[path] ? @files[path].merge!(data) : @files[path] = data
end
@files.each do |k, file_hash|
@files[k] = StatusFile.new(@base, file_hash)
end
end
end
end
ruby-git-1.2.8/lib/git/version.rb 0000664 0000000 0000000 00000000155 12366517705 0016644 0 ustar 00root root 0000000 0000000 module Git
# The current gem version
# @return [String] the current gem version.
VERSION='1.2.8'
end
ruby-git-1.2.8/lib/git/working_directory.rb 0000664 0000000 0000000 00000000072 12366517705 0020721 0 ustar 00root root 0000000 0000000 module Git
class WorkingDirectory < Git::Path
end
end
ruby-git-1.2.8/tests/ 0000775 0000000 0000000 00000000000 12366517705 0014442 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/all_tests.rb 0000664 0000000 0000000 00000000242 12366517705 0016757 0 ustar 00root root 0000000 0000000 Dir.chdir(File.dirname(__FILE__)) do
Dir.glob('**/test_*.rb') do |test_case|
require "#{File.expand_path(File.dirname(__FILE__))}/#{test_case}"
end
end
ruby-git-1.2.8/tests/files/ 0000775 0000000 0000000 00000000000 12366517705 0015544 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/index 0000664 0000000 0000000 00000000400 12366517705 0016570 0 ustar 00root root 0000000 0000000 DIRC G2]d G2]d pÏ¢ ¤ õ õ æâ›²ÑÖCK‹)®wZØÂäŒS‘
ex_dir/ex.txt G2]Y G2]Y pÏ ¤ õ õ æâ›²ÑÖCK‹)®wZØÂäŒS‘ example.txt TREE 8 2 1
ÀØFÏ€°yçcã\:òsðÊex_dir 1 0
ky
Ü^«0ñŒ«ÝèøÚÀÒÓ퉙<àh`!µ,>G,2"ØÖ ruby-git-1.2.8/tests/files/working.git/ 0000775 0000000 0000000 00000000000 12366517705 0020006 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/HEAD 0000664 0000000 0000000 00000000027 12366517705 0020431 0 ustar 00root root 0000000 0000000 ref: refs/heads/master
ruby-git-1.2.8/tests/files/working.git/config 0000664 0000000 0000000 00000000102 12366517705 0021167 0 ustar 00root root 0000000 0000000 [core]
repositoryformatversion = 0
filemode = true
bare = true
ruby-git-1.2.8/tests/files/working.git/description 0000664 0000000 0000000 00000000072 12366517705 0022253 0 ustar 00root root 0000000 0000000 Unnamed repository; edit this file to name it for gitweb.
ruby-git-1.2.8/tests/files/working.git/hooks/ 0000775 0000000 0000000 00000000000 12366517705 0021131 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/hooks/applypatch-msg 0000664 0000000 0000000 00000000671 12366517705 0024011 0 ustar 00root root 0000000 0000000 #!/bin/sh
#
# An example hook script to check the commit log message taken by
# applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit. The hook is
# allowed to edit the commit message file.
#
# To enable this hook, make this file executable.
. git-sh-setup
test -x "$GIT_DIR/hooks/commit-msg" &&
exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
:
ruby-git-1.2.8/tests/files/working.git/hooks/commit-msg 0000664 0000000 0000000 00000001414 12366517705 0023130 0 ustar 00root root 0000000 0000000 #!/bin/sh
#
# An example hook script to check the commit log message.
# Called by git-commit with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, make this file executable.
# Uncomment the below to add a Signed-off-by line to the message.
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
# This example catches duplicate Signed-off-by lines.
test "" = "$(grep '^Signed-off-by: ' "$1" |
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
echo >&2 Duplicate Signed-off-by lines.
exit 1
}
ruby-git-1.2.8/tests/files/working.git/hooks/post-commit 0000664 0000000 0000000 00000000230 12366517705 0023322 0 ustar 00root root 0000000 0000000 #!/bin/sh
#
# An example hook script that is called after a successful
# commit is made.
#
# To enable this hook, make this file executable.
: Nothing
ruby-git-1.2.8/tests/files/working.git/hooks/post-receive 0000664 0000000 0000000 00000000776 12366517705 0023473 0 ustar 00root root 0000000 0000000 #!/bin/sh
#
# An example hook script for the post-receive event
#
# This script is run after receive-pack has accepted a pack and the
# repository has been updated. It is passed arguments in through stdin
# in the form
#
# For example:
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
#
# see contrib/hooks/ for an sample, or uncomment the next line (on debian)
#
#. /usr/share/doc/git-core/contrib/hooks/post-receive-email
ruby-git-1.2.8/tests/files/working.git/hooks/post-update 0000664 0000000 0000000 00000000317 12366517705 0023322 0 ustar 00root root 0000000 0000000 #!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, make this file executable by "chmod +x post-update".
exec git-update-server-info
ruby-git-1.2.8/tests/files/working.git/hooks/pre-applypatch 0000664 0000000 0000000 00000000603 12366517705 0024004 0 ustar 00root root 0000000 0000000 #!/bin/sh
#
# An example hook script to verify what is about to be committed
# by applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit.
#
# To enable this hook, make this file executable.
. git-sh-setup
test -x "$GIT_DIR/hooks/pre-commit" &&
exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
:
ruby-git-1.2.8/tests/files/working.git/hooks/pre-commit 0000664 0000000 0000000 00000003237 12366517705 0023135 0 ustar 00root root 0000000 0000000 #!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by git-commit with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, make this file executable.
# This is slightly modified from Andrew Morton's Perfect Patch.
# Lines you introduce should not have trailing whitespace.
# Also check for an indentation that has SP before a TAB.
if git-rev-parse --verify HEAD 2>/dev/null
then
git-diff-index -p -M --cached HEAD
else
# NEEDSWORK: we should produce a diff with an empty tree here
# if we want to do the same verification for the initial import.
:
fi |
perl -e '
my $found_bad = 0;
my $filename;
my $reported_filename = "";
my $lineno;
sub bad_line {
my ($why, $line) = @_;
if (!$found_bad) {
print STDERR "*\n";
print STDERR "* You have some suspicious patch lines:\n";
print STDERR "*\n";
$found_bad = 1;
}
if ($reported_filename ne $filename) {
print STDERR "* In $filename\n";
$reported_filename = $filename;
}
print STDERR "* $why (line $lineno)\n";
print STDERR "$filename:$lineno:$line\n";
}
while (<>) {
if (m|^diff --git a/(.*) b/\1$|) {
$filename = $1;
next;
}
if (/^@@ -\S+ \+(\d+)/) {
$lineno = $1 - 1;
next;
}
if (/^ /) {
$lineno++;
next;
}
if (s/^\+//) {
$lineno++;
chomp;
if (/\s$/) {
bad_line("trailing whitespace", $_);
}
if (/^\s* /) {
bad_line("indent SP followed by a TAB", $_);
}
if (/^(?:[<>=]){7}/) {
bad_line("unresolved merge conflict", $_);
}
}
}
exit($found_bad);
'
ruby-git-1.2.8/tests/files/working.git/hooks/pre-rebase 0000664 0000000 0000000 00000010246 12366517705 0023104 0 ustar 00root root 0000000 0000000 #!/bin/sh
#
# Copyright (c) 2006 Junio C Hamano
#
publish=next
basebranch="$1"
if test "$#" = 2
then
topic="refs/heads/$2"
else
topic=`git symbolic-ref HEAD`
fi
case "$basebranch,$topic" in
master,refs/heads/??/*)
;;
*)
exit 0 ;# we do not interrupt others.
;;
esac
# Now we are dealing with a topic branch being rebased
# on top of master. Is it OK to rebase it?
# Is topic fully merged to master?
not_in_master=`git-rev-list --pretty=oneline ^master "$topic"`
if test -z "$not_in_master"
then
echo >&2 "$topic is fully merged to master; better remove it."
exit 1 ;# we could allow it, but there is no point.
fi
# Is topic ever merged to next? If so you should not be rebasing it.
only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort`
only_next_2=`git-rev-list ^master ${publish} | sort`
if test "$only_next_1" = "$only_next_2"
then
not_in_topic=`git-rev-list "^$topic" master`
if test -z "$not_in_topic"
then
echo >&2 "$topic is already up-to-date with master"
exit 1 ;# we could allow it, but there is no point.
else
exit 0
fi
else
not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"`
perl -e '
my $topic = $ARGV[0];
my $msg = "* $topic has commits already merged to public branch:\n";
my (%not_in_next) = map {
/^([0-9a-f]+) /;
($1 => 1);
} split(/\n/, $ARGV[1]);
for my $elem (map {
/^([0-9a-f]+) (.*)$/;
[$1 => $2];
} split(/\n/, $ARGV[2])) {
if (!exists $not_in_next{$elem->[0]}) {
if ($msg) {
print STDERR $msg;
undef $msg;
}
print STDERR " $elem->[1]\n";
}
}
' "$topic" "$not_in_next" "$not_in_master"
exit 1
fi
exit 0
################################################################
This sample hook safeguards topic branches that have been
published from being rewound.
The workflow assumed here is:
* Once a topic branch forks from "master", "master" is never
merged into it again (either directly or indirectly).
* Once a topic branch is fully cooked and merged into "master",
it is deleted. If you need to build on top of it to correct
earlier mistakes, a new topic branch is created by forking at
the tip of the "master". This is not strictly necessary, but
it makes it easier to keep your history simple.
* Whenever you need to test or publish your changes to topic
branches, merge them into "next" branch.
The script, being an example, hardcodes the publish branch name
to be "next", but it is trivial to make it configurable via
$GIT_DIR/config mechanism.
With this workflow, you would want to know:
(1) ... if a topic branch has ever been merged to "next". Young
topic branches can have stupid mistakes you would rather
clean up before publishing, and things that have not been
merged into other branches can be easily rebased without
affecting other people. But once it is published, you would
not want to rewind it.
(2) ... if a topic branch has been fully merged to "master".
Then you can delete it. More importantly, you should not
build on top of it -- other people may already want to
change things related to the topic as patches against your
"master", so if you need further changes, it is better to
fork the topic (perhaps with the same name) afresh from the
tip of "master".
Let's look at this example:
o---o---o---o---o---o---o---o---o---o "next"
/ / / /
/ a---a---b A / /
/ / / /
/ / c---c---c---c B /
/ / / \ /
/ / / b---b C \ /
/ / / / \ /
---o---o---o---o---o---o---o---o---o---o---o "master"
A, B and C are topic branches.
* A has one fix since it was merged up to "next".
* B has finished. It has been fully merged up to "master" and "next",
and is ready to be deleted.
* C has not merged to "next" at all.
We would want to allow C to be rebased, refuse A, and encourage
B to be deleted.
To compute (1):
git-rev-list ^master ^topic next
git-rev-list ^master next
if these match, topic has not merged in next at all.
To compute (2):
git-rev-list master..topic
if this is empty, it is fully merged to "master".
ruby-git-1.2.8/tests/files/working.git/hooks/update 0000664 0000000 0000000 00000003701 12366517705 0022337 0 ustar 00root root 0000000 0000000 #!/bin/sh
#
# An example hook script to blocks unannotated tags from entering.
# Called by git-receive-pack with arguments: refname sha1-old sha1-new
#
# To enable this hook, make this file executable by "chmod +x update".
#
# Config
# ------
# hooks.allowunannotated
# This boolean sets whether unannotated tags will be allowed into the
# repository. By default they won't be.
#
# --- Command line
refname="$1"
oldrev="$2"
newrev="$3"
# --- Safety check
if [ -z "$GIT_DIR" ]; then
echo "Don't run this script from the command line." >&2
echo " (if you want, you could supply GIT_DIR then run" >&2
echo " $0 [ )" >&2
exit 1
fi
if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
echo "Usage: $0 ][ " >&2
exit 1
fi
# --- Config
allowunannotated=$(git-repo-config --bool hooks.allowunannotated)
# check for no description
projectdesc=$(sed -e '1p' "$GIT_DIR/description")
if [ -z "$projectdesc" -o "$projectdesc" = "Unnamed repository; edit this file to name it for gitweb" ]; then
echo "*** Project description file hasn't been set" >&2
exit 1
fi
# --- Check types
# if $newrev is 0000...0000, it's a commit to delete a branch
if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then
newrev_type=commit
else
newrev_type=$(git-cat-file -t $newrev)
fi
case "$refname","$newrev_type" in
refs/tags/*,commit)
# un-annotated tag
short_refname=${refname##refs/tags/}
if [ "$allowunannotated" != "true" ]; then
echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
exit 1
fi
;;
refs/tags/*,tag)
# annotated tag
;;
refs/heads/*,commit)
# branch
;;
refs/remotes/*,commit)
# tracking branch
;;
*)
# Anything else (is there anything else?)
echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
exit 1
;;
esac
# --- Finished
exit 0
ruby-git-1.2.8/tests/files/working.git/info/ 0000775 0000000 0000000 00000000000 12366517705 0020741 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/info/exclude 0000664 0000000 0000000 00000000360 12366517705 0022314 0 ustar 00root root 0000000 0000000 # git-ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
ruby-git-1.2.8/tests/files/working.git/objects/ 0000775 0000000 0000000 00000000000 12366517705 0021437 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/00/ 0000775 0000000 0000000 00000000000 12366517705 0021656 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/00/62cdf4c1e63069eececf54325535e91fd57c42 0000664 0000000 0000000 00000000130 12366517705 0027075 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(aØ6/ëlûÓŸ‚>Ï"¸9ã>²Võ?Ý
ûÊ"] ruby-git-1.2.8/tests/files/working.git/objects/00/ea60e1331b184386392037a7267dfb4a7c7d86 0000664 0000000 0000000 00000000253 12366517705 0026574 0 ustar 00root root 0000000 0000000 xŽ]j1„ûìSø
þ“£…P=‰V–š}Øuð*ÐãÇô}›˜û¾oæS6D|fͰ¶XXASk×UD±.Ø®!h¦Q€Ý“†æ¡ c¤$ØbŒ©^3TÅ(ÍQ+<ïêèe>üÉÝÌ?ˆûáo'ÿ…;ýPëãœLÛøu^¸çe±íw¶ýËǸ(KôŸCpsæ&ÿÉtSd;ÜÕY ruby-git-1.2.8/tests/files/working.git/objects/01/ 0000775 0000000 0000000 00000000000 12366517705 0021657 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/01/0b7b79019cb510d8c5849704fd10541655916d 0000664 0000000 0000000 00000000024 12366517705 0026432 0 ustar 00root root 0000000 0000000 xKÊÉOR°0a0ä¢> aDÚ ruby-git-1.2.8/tests/files/working.git/objects/01/dd46ebe07fc30c10c85c2e926c70f2d7058a6b 0000664 0000000 0000000 00000000130 12366517705 0027136 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(a0î;ÍØ|•ݳëí¶ÌíÓ¶ü|ÑÁÏ ñÉ" ruby-git-1.2.8/tests/files/working.git/objects/02/ 0000775 0000000 0000000 00000000000 12366517705 0021660 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/02/b2a02844d00574c234d17bec6294e832f3c4c1 0000664 0000000 0000000 00000000130 12366517705 0026624 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(apc-eÛ§ðZ”qÉǨ g-Wv¾K Ù‡!= ruby-git-1.2.8/tests/files/working.git/objects/06/ 0000775 0000000 0000000 00000000000 12366517705 0021664 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/06/f4e8a840d23fc0ab94895a5d16827a19f75fb7 0000664 0000000 0000000 00000000024 12366517705 0027034 0 ustar 00root root 0000000 0000000 xKÊÉOR05`0ä" ,è ruby-git-1.2.8/tests/files/working.git/objects/0b/ 0000775 0000000 0000000 00000000000 12366517705 0021740 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/0b/2fe00801b62b7760c23d554796b05abc16af92 0000664 0000000 0000000 00000000130 12366517705 0026710 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(aÐ~–~ñF_éæ_ü³¶=ºñÿ²–( ‚#C ruby-git-1.2.8/tests/files/working.git/objects/0b/5262f6ee3552a99b7081a317e8289d6a4d8e72 0000664 0000000 0000000 00000000025 12366517705 0026675 0 ustar 00root root 0000000 0000000 xKÊÉOR044c0ä¢? 1¶ ruby-git-1.2.8/tests/files/working.git/objects/0b/c0d846cf80b079e763e35c3af273171bf01fca 0000664 0000000 0000000 00000000130 12366517705 0027137 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(ax6÷ÑìM¯9{wk®+ºqèIOðD
x#É ruby-git-1.2.8/tests/files/working.git/objects/0d/ 0000775 0000000 0000000 00000000000 12366517705 0021742 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/0d/2c47f07277b3ea30b0884f8e3acd68440507c8 0000664 0000000 0000000 00000000253 12366517705 0026740 0 ustar 00root root 0000000 0000000 xŽAn!E»æ\ ž1†HQ©'1Æ4³˜!b©Çêºûï/žžô}ßÌ/D6T=6a))7% bMº†[”ȈTjÈÅ=yèaž–$5ÌÂJ ”„±VÒšÆj^኎_öèßÒÍü÷ƒ¥þvÊ߸ó×>Îé´M^çEúx^†²ØØ~'í_¦$â•VôŸ!‡àæ;ËMÿÓéfÈv¸7çX ruby-git-1.2.8/tests/files/working.git/objects/0d/519ca9c2eddc44431efe135d0fc8df00e0b975 0000664 0000000 0000000 00000000252 12366517705 0027310 0 ustar 00root root 0000000 0000000 xŽ[jÃ0EûUh1ifdC(¬d¬Gã[AC—Ñ5ôï>àpRÛ÷MgþÒ^ŠÅè*Ë«äì©r^]ÅèIJˆqŒ¸bó–^µ3TB
½óÈ<^ bâ"ÈAh]0 U#—¾Z·gjªöù’Ô{?Ó_xÈäÖÏÁÔ-]ç”ZO½HÒ¾ý޶[€ F¶77;gÆ:̵ü'Ó‘í0§cV_ ruby-git-1.2.8/tests/files/working.git/objects/0f/ 0000775 0000000 0000000 00000000000 12366517705 0021744 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/0f/845a0a981bc2f61354fcdd2b6eafe2b2c55c2d 0000664 0000000 0000000 00000000250 12366517705 0027360 0 ustar 00root root 0000000 0000000 xŽA E]s
.`…ÂcâIÆaj»hi`šx|‰gp÷ß_¼<*Û¶ŠC¸HeÖ92xÏLnÌÑ£Ë.’'6¬ƒ0[ã¦Ô•wÑÐÒÇ”‚ Ì4#²CB;ù“Ë
OYJÕŠˆ~.He×·F¿ñÀ7æR[wÊJg¨Ôc¨Œ$uýtÚîÚÚä»+¸¤¯ŒQýíåÂÿtª²îê¸X- ruby-git-1.2.8/tests/files/working.git/objects/0f/f4a0357c3d7221a2ef1e4c6b7d5c46d97fe250 0000664 0000000 0000000 00000000130 12366517705 0027146 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(aðÒ~0ÅoRë‹Jb'7ìX~ùìeQ õÈ"å ruby-git-1.2.8/tests/files/working.git/objects/12/ 0000775 0000000 0000000 00000000000 12366517705 0021661 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/12/eb889f49f1464b32a51424d7724fb16f6c3a31 0000664 0000000 0000000 00000000130 12366517705 0026653 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(a°Î{wóœó«N›/½j¶+M<Þ®›/ ýU"P ruby-git-1.2.8/tests/files/working.git/objects/15/ 0000775 0000000 0000000 00000000000 12366517705 0021664 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/15/34a65657edf4e5caaa5ce35652dca5e4c7d316 0000664 0000000 0000000 00000000130 12366517705 0027230 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(axÉûB¹øÉߨÆÛKbÝ߈5Ú ö¾!x ruby-git-1.2.8/tests/files/working.git/objects/15/378a1f3eafe4c5ab4f890883356df917ee5539 0000664 0000000 0000000 00000000251 12366517705 0027050 0 ustar 00root root 0000000 0000000 xŽQ
Â0DýÎ)r%i7éDO²Ùl´mJº‚Ç7xÿf†áñ¸®ë¢vˆñ¤MÄ&? L"D‘‹ä‘æ&Ì ýU(!NÌNM6µ&‚D2—g‘ìòòè„èIh₆ÞúªÍ\UíãE\7{=øîô¤\ÛÑ™ºðû¸pmû¥ ±¶åÓÛz³ÞÏ`Ž€öìÐ9Ó×n®òO¦é"Ëf¾Ü{Y ruby-git-1.2.8/tests/files/working.git/objects/16/ 0000775 0000000 0000000 00000000000 12366517705 0021665 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/16/9e6db43d4c09cd610179a7b9826483b4d94123 0000664 0000000 0000000 00000000130 12366517705 0026604 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(a`ä®®dœ³UàÆÑ–é,BÄB'æ Öú© ruby-git-1.2.8/tests/files/working.git/objects/16/d1f96acfd92d09c4f1f56d3441ac55dd30500e 0000664 0000000 0000000 00000000024 12366517705 0027145 0 ustar 00root root 0000000 0000000 xKÊÉOR0¶`0ä" µQŒ ruby-git-1.2.8/tests/files/working.git/objects/16/ee5335538f11b4ffcc17b051f8d5db7570a055 0000664 0000000 0000000 00000000024 12366517705 0027010 0 ustar 00root root 0000000 0000000 xKÊÉOR03a0ä¢ ˆÉ Š ruby-git-1.2.8/tests/files/working.git/objects/17/ 0000775 0000000 0000000 00000000000 12366517705 0021666 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/17/9ef0e0209e90af00f544ff414e0674dfb5f5c7 0000664 0000000 0000000 00000000024 12366517705 0027101 0 ustar 00root root 0000000 0000000 xKÊÉOR01`0ä" Á°À ruby-git-1.2.8/tests/files/working.git/objects/19/ 0000775 0000000 0000000 00000000000 12366517705 0021670 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/19/9d2f8e60fddd1bb2a1b0bddedde35e5aa8b03f 0000664 0000000 0000000 00000000130 12366517705 0027654 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(açž¾2ÀýTœe¸ÈŒ¨_o7¶}9 ãc" ruby-git-1.2.8/tests/files/working.git/objects/1c/ 0000775 0000000 0000000 00000000000 12366517705 0021742 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/1c/c8667014381e2788a94777532a788307f38d26 0000664 0000000 0000000 00000000252 12366517705 0026334 0 ustar 00root root 0000000 0000000 xŽAŠÃ0EgíSøìÔ–e(CaN¢HÊ$‹ÔÅVaŽßÐ3t÷ß[<>·ãØÍÏ¿¬«úšç‚%ëÌ$.Œ’X¤†°ÆJTá’¸¸u½›Ï eXˬ+¥(Yj¡Ô FÈÊBAÔÑÓ¶Öýàfæ7âv÷×Áïq£?’ÖÇÙ´ŸcâÖSWbëûÿIDZ¦1"úï€!¸ÓžÏM?Ùt¦ÃÜe>X² ruby-git-1.2.8/tests/files/working.git/objects/1c/fcfba04eb4e461e9f930d22f528023ab1ddefc 0000664 0000000 0000000 00000000025 12366517705 0027436 0 ustar 00root root 0000000 0000000 xKÊÉOR044a0ä¢7 Ëy ruby-git-1.2.8/tests/files/working.git/objects/1d/ 0000775 0000000 0000000 00000000000 12366517705 0021743 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/1d/7be4117ded4534789d85c42ab579644cd3fa12 0000664 0000000 0000000 00000000130 12366517705 0027023 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(a¸|±PI®}1ëÜä~ÑøÎ©Sof å{ ¾ ruby-git-1.2.8/tests/files/working.git/objects/1d/9e4767a95047ca5e395714985afaedb186f4cd 0000664 0000000 0000000 00000000023 12366517705 0027124 0 ustar 00root root 0000000 0000000 xKÊÉOR06`0ä‚ݘ ruby-git-1.2.8/tests/files/working.git/objects/1f/ 0000775 0000000 0000000 00000000000 12366517705 0021745 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/1f/09f2edb9c0d9275d15960771b363ca6940fbe3 0000664 0000000 0000000 00000000046 12366517705 0027027 0 ustar 00root root 0000000 0000000 xKÊÉOR02b(J-ÈILNU(Ï,ÉPÈK-W(I(á ›È
5 ruby-git-1.2.8/tests/files/working.git/objects/1f/691b879df15cf6742502ffc59833b4a40e7aef 0000664 0000000 0000000 00000000166 12366517705 0027125 0 ustar 00root root 0000000 0000000 x+)JMU040a01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(açüôvç›ê±¢ÓØ7'ŸÊtøýbNqr~I ƒž‚°^ÿžÍ/”<&ΘÀkø±1 é´-} ruby-git-1.2.8/tests/files/working.git/objects/23/ 0000775 0000000 0000000 00000000000 12366517705 0021663 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/23/751ef6c1fed1304ae1d07020aa73da6f2b93b0 0000664 0000000 0000000 00000000023 12366517705 0027114 0 ustar 00root root 0000000 0000000 xKÊÉOR0²`0äÂ
xˆd ruby-git-1.2.8/tests/files/working.git/objects/24/ 0000775 0000000 0000000 00000000000 12366517705 0021664 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/24/5582a71306d7360e40c07cd7d849a1aa14a31e 0000664 0000000 0000000 00000000130 12366517705 0026627 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(aab°ˆ±æÖœSÕþæëœ•>F¿÷Í Ð ruby-git-1.2.8/tests/files/working.git/objects/26/ 0000775 0000000 0000000 00000000000 12366517705 0021666 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/26/3e3c527004e7b742ed1f747c1bfb7e11825d7a 0000664 0000000 0000000 00000000130 12366517705 0027006 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(a°IñWÚ¹ã톼:;S'žK$~ î!¬ ruby-git-1.2.8/tests/files/working.git/objects/27/ 0000775 0000000 0000000 00000000000 12366517705 0021667 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/27/c0c003dda3e59ba236f53f6661faaf74432b5c 0000664 0000000 0000000 00000000130 12366517705 0027134 0 ustar 00root root 0000000 0000000 x+)JMU07b01 …ÔŠø”Ì"†ìJÞ;q«
>ö¬¾Ë*üâÇ—.¿540031ªHÌ-ÈIÕ+©(aˆÙËô\³~¶Éå"ç¥
w$— â* é ruby-git-1.2.8/tests/files/working.git/objects/29/ 0000775 0000000 0000000 00000000000 12366517705 0021671 5 ustar 00root root 0000000 0000000 ruby-git-1.2.8/tests/files/working.git/objects/29/1b6be488d6abc586d3ee03ca61238766625a75 0000664 0000000 0000000 00000000251 12366517705 0026751 0 ustar 00root root 0000000 0000000 xŽAÂ E]s
.`3 1ÆÄ“Ðé ]´4tšx|‰gp÷ß_¼<ªëºˆ/Ò˜5“a;;ÇMœ§2åaò„D–1DV{n¼‰Ž]