git-ce 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d274c0da6b1ae1db1b1b0157c41d081ced0012ebf3623a059d6a740018e362bc
4
+ data.tar.gz: f5ef516ae6892b64aecf6f7db37e5b7c29d22d6bc745bee9bf52f12357dc3508
5
+ SHA512:
6
+ metadata.gz: 7a19e2ca8afea46f96a24c160c44cd265865eb1855325a6707a1413fd6e8b3bf00a59d31bcfd5a5344ef1ffbf263158ef516d0cbc8de8857b7158c82be9e0c62
7
+ data.tar.gz: b0806117c6c7a9102f31ad4835854aba31656208cd0a30f9156abf67f1ae57d8d92b2f4670e120f0bf8382d364a4ccffc53aaee83de0a82d9b304feff09d816f
data/CHANGELOG.md ADDED
@@ -0,0 +1,94 @@
1
+ # Change Log
2
+
3
+ ## 1.5.0
4
+
5
+ See https://github.com/ruby-git/ruby-git/releases/tag/v1.5.0
6
+
7
+ ## 1.4.0
8
+
9
+ See https://github.com/ruby-git/ruby-git/releases/tag/v1.4.0
10
+
11
+ ## 1.3.0
12
+
13
+ * Dropping Ruby 1.8.x support
14
+
15
+ ## 1.2.10
16
+
17
+ * Adding Git::Diff.name_status
18
+ * Checking and fixing encoding on commands output to prevent encoding errors afterwards
19
+
20
+ ## 1.2.9
21
+
22
+ * Adding Git.configure (to configure the git env)
23
+ * Adding Git.ls_remote [Git.ls_remote(repo_path_or_url='.')]
24
+ * Adding Git.describe [repo.describe(objectish, opts)]
25
+ * Adding Git.show [repo.show(objectish=nil, path=nil)]
26
+ * Fixing Git::Diff to support default references (implicit references)
27
+ * Fixing Git::Diff to support diff over git .patch files
28
+ * Fixing Git.checkout when using :new_branch opt
29
+ * Fixing Git::Object::Commit to preserve its sha after fetching metadata
30
+ * Fixing Git.is_remote_branch? to actually check against remote branches
31
+ * Improvements over how ENV variables are modified
32
+ * Improving thrade safety (using --git-dir and --work-tree git opts)
33
+ * Improving Git::Object::Tag. Adding annotated?, tagger and message
34
+ * Supporting a submodule path as a valid repo
35
+ * Git.checkout - supporting -f and -b
36
+ * Git.clone - supporting --branch
37
+ * Git.fetch - supporting --prune
38
+ * Git.tag - supporting
39
+
40
+ ## 1.2.8
41
+
42
+ * Keeping the old escape format for windows users
43
+ * revparse: Supporting ref names containing SHA like substrings (40-hex strings)
44
+ * Fix warnings on Ruby 2.1.2
45
+
46
+ ## 1.2.7
47
+
48
+ * Fixing mesages encoding
49
+ * Fixing -f flag in git push
50
+ * Fixing log parser for multiline messages
51
+ * Supporting object references on Git.add_tag
52
+ * Including dotfiles on Git.status
53
+ * Git.fetch - supporting --tags
54
+ * Git.clean - supporting -x
55
+ * Git.add_tag options - supporting -a, -m and -s
56
+ * Added Git.delete_tag
57
+
58
+ ## 1.2.6
59
+
60
+ * Ruby 1.9.X/2.0 fully supported
61
+ * JRuby 1.8/1.9 support
62
+ * Rubinius support
63
+ * Git.clone - supporting --recursive and --config
64
+ * Git.log - supporting last and [] over the results
65
+ * Git.add_remote - supporting -f and -t
66
+ * Git.add - supporting --fore
67
+ * Git.init - supporting --bare
68
+ * Git.commit - supporting --all and --amend
69
+ * Added Git.remote_remote, Git.revert and Git.clean
70
+ * Added Bundler to the formula
71
+ * Travis configuration
72
+ * Licence included with the gem
73
+
74
+ ## 1.0.4
75
+
76
+ * added camping/gitweb.rb frontend
77
+ * added a number of speed-ups
78
+
79
+ ## 1.0.3
80
+
81
+ * Sped up most of the operations
82
+ * Added some predicate functions (commit?, tree?, etc)
83
+ * Added a number of lower level operations (read-tree, write-tree, checkout-index, etc)
84
+ * Fixed a bug with using bare repositories
85
+ * Updated a good amount of the documentation
86
+
87
+ ## 1.0.2
88
+
89
+ * Added methods to the git objects that might be helpful
90
+
91
+ ## 1.0.1
92
+
93
+ * Initial version
94
+
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,135 @@
1
+ # ruby-git-ce
2
+
3
+ The ruby-git Community Edition is a fork of the awesome but incomplete and
4
+ unmaintained ruby-git gem.
5
+
6
+ The aim of this fork is to accept people's pull requests, then allow to accept
7
+ other pull requests, and so on.
8
+
9
+ With this principle, when I'll not be available next time, this repository will
10
+ not be abandoned, and people can still rely on it.
11
+ I want to be sure this little piece of love, that is this library, will never
12
+ stop growing, even when I'll be on something else.
13
+
14
+ BTW there will be NO stupid bots closing your PRs ! (Who the hell is the stupid
15
+ guy who invented this absurd concept ... 🤦‍)
16
+
17
+ If this kind of ways is working fine, that would be great to creation an
18
+ organisation to group those Community Editions all together.
19
+
20
+ Anyway, it's a new concept I'd like to try ! 😉
21
+
22
+ # Contributing to ruby-git-ce
23
+
24
+ Thank you for your interest in contributing to this project.
25
+
26
+ These are mostly guidelines, not rules.
27
+ Use your best judgment, and feel free to propose changes to this document in a
28
+ pull request.
29
+
30
+ #### Table Of Contents
31
+
32
+ [How Can I Contribute?](#how-can-i-contribute)
33
+ * [Submitting Issues](#submitting-issues)
34
+ * [Contribution Process](#contribution-process)
35
+ * [Pull Request Requirements](#pull-request-requirements)
36
+ * [Code Review Process](#code-review-process)
37
+ * [Developer Certification of Origin (DCO)](#developer-certification-of-origin-dco)
38
+
39
+
40
+ ## How Can I Contribute?
41
+
42
+ ### Submitting Issues
43
+
44
+ We utilize **GitHub Issues** for issue tracking and contributions.
45
+ You can contribute in two ways:
46
+
47
+ 1. Reporting an issue or making a feature request [here](https://github.com/zedtux/ruby-git-ce/issues/new).
48
+ 2. Adding features or fixing bugs yourself and contributing your code to
49
+ ruby-git-ce.
50
+
51
+ ### Contribution Process
52
+
53
+ We have a 3 step process for contributions:
54
+
55
+ 1. Commit changes to a git branch in your fork. Making sure to sign-off those
56
+ changes for the [Developer Certificate of Origin](#developer-certification-of-origin-dco).
57
+ 2. Create a GitHub Pull Request for your change, following the instructions in
58
+ the pull request template.
59
+ 3. Perform a [Code Review](#code-review-process) with the project maintainers
60
+ on the pull request.
61
+
62
+ ### Pull Request Requirements
63
+ In order to ensure high quality, we require that all pull requests to this
64
+ project meet these specifications:
65
+
66
+ 1. Unit Testing: We require all the new code to include unit tests, and any
67
+ fixes to pass previous units.
68
+ 2. Green CI Tests: We are using [Travis CI](https://travis-ci.org/zedtux/ruby-git-ce)
69
+ to run unit tests on various ruby versions, we expect them to all pass before a
70
+ pull request will be merged.
71
+ 3. Up-to-date Documentation: New methods as well as updated methods should have
72
+ [YARD](https://yardoc.org/) documentation added to them
73
+
74
+ ### Code Review Process
75
+
76
+ Code review takes place in GitHub pull requests. See [this article](https://help.github.com/articles/about-pull-requests/)
77
+ if you're not familiar with GitHub Pull Requests.
78
+
79
+ Once you open a pull request, project maintainers will review your code and
80
+ respond to your pull request with any feedback they might have.
81
+
82
+ The process at this point is as follows:
83
+
84
+ 1. One thumbs-up (:+1:) is required from project maintainers. See the master
85
+ maintainers document for the ruby-git-ce project at <https://github.com/zedtux/ruby-git-ce/blob/master/MAINTAINERS.md>.
86
+ 2. When ready, your pull request will be merged into `master`, we may require
87
+ you to rebase your PR to the latest `master`.
88
+
89
+ ### Developer Certification of Origin (DCO)
90
+
91
+ Licensing is very important to open source projects. It helps ensure the
92
+ software continues to be available under the terms that the author desired.
93
+
94
+ ruby-git-ce uses [the MIT license](https://github.com/zedtux/ruby-git-ce/blob/master/LICENSE)
95
+
96
+ Detail about the LICENSE can be found [here](https://choosealicense.com/licenses/mit/)
97
+
98
+ To make a good faith effort to ensure these criteria are met, ruby-git-ce
99
+ requires the Developer Certificate of Origin (DCO) process to be followed.
100
+
101
+ The DCO is an attestation attached to every contribution made by every
102
+ developer.
103
+
104
+ In the commit message of the contribution, the developer simply adds a
105
+ Signed-off-by statement and thereby agrees to the DCO, which you can find below
106
+ or at <http://developercertificate.org/>.
107
+
108
+ ```
109
+ Developer's Certificate of Origin 1.1
110
+
111
+ By making a contribution to this project, I certify that:
112
+
113
+ (a) The contribution was created in whole or in part by me and I
114
+ have the right to submit it under the open source license
115
+ indicated in the file; or
116
+
117
+ (b) The contribution is based upon previous work that, to the
118
+ best of my knowledge, is covered under an appropriate open
119
+ source license and I have the right under that license to
120
+ submit that work with modifications, whether created in whole
121
+ or in part by me, under the same open source license (unless
122
+ I am permitted to submit under a different license), as
123
+ Indicated in the file; or
124
+
125
+ (c) The contribution was provided directly to me by some other
126
+ person who certified (a), (b) or (c) and I have not modified
127
+ it.
128
+
129
+ (d) I understand and agree that this project and the contribution
130
+ are public and that a record of the contribution (including
131
+ all personal information I submit with it, including my
132
+ sign-off) is maintained indefinitely and may be redistributed
133
+ consistent with this project or the open source license(s)
134
+ involved.
135
+ ```
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2008 Scott Chacon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/MAINTAINERS.md ADDED
@@ -0,0 +1,8 @@
1
+ # Maintainers
2
+
3
+ When making changes to the system, this file tells you who needs to review your patch - you need at least two maintainers to provide a :+1: on your pull request.
4
+
5
+ ### Maintainers
6
+
7
+ * [Per Lundberg](https://github.com/perlun)
8
+ * [Vern Burton](https://github.com/tarcinil)
data/README.md ADDED
@@ -0,0 +1,313 @@
1
+ # Git Library for Ruby
2
+
3
+ Library for using Git in Ruby.
4
+
5
+ ## Homepage
6
+
7
+ Git public hosting of the project source code is at:
8
+
9
+ http://github.com/zedtux/ruby-git-ce
10
+
11
+ ## Install
12
+
13
+ You can install Ruby/Git like this:
14
+
15
+ $ sudo gem install git
16
+
17
+ ## Code Status
18
+
19
+ * [![Build Status](https://travis-ci.org/zedtux/ruby-git-ce.svg?branch=master)](https://travis-ci.org/zedtux/ruby-git-ce)
20
+ * [![Code Climate](https://codeclimate.com/github/zedtux/ruby-git-ce.png)](https://codeclimate.com/github/zedtux/ruby-git-ce)
21
+ * [![Gem Version](https://badge.fury.io/rb/git.png)](http://badge.fury.io/rb/git)
22
+
23
+ ## Major Objects
24
+
25
+ **Git::Base** - The object returned from a `Git.open` or `Git.clone`.
26
+ Most major actions are called from this object.
27
+
28
+ **Git::Object** - The base object for your tree, blob and commit objects,
29
+ returned from `@git.gtree` or `@git.object` calls. the `Git::AbstractObject`
30
+ will have most of the calls in common for all those objects.
31
+
32
+ **Git::Diff** - returns from a `@git.diff` command. It is an Enumerable that
33
+ returns `Git::Diff:DiffFile` objects from which you can get per file patches and
34
+ insertion/deletion statistics. You can also get total statistics from the
35
+ Git::Diff object directly.
36
+
37
+ **Git::Status** - returns from a `@git.status` command. It is an Enumerable
38
+ that returns `Git:Status::StatusFile` objects for each object in git, which
39
+ includes files in the working directory, in the index and in the repository.
40
+ Similar to running 'git status' on the command line to determine untracked and
41
+ changed files.
42
+
43
+ **Git::Branches** - Enumerable object that holds `Git::Branch objects`.
44
+ You can call .local or .remote on it to filter to just your local or remote
45
+ branches.
46
+
47
+ **Git::Remote**- A reference to a remote repository that is tracked by this
48
+ repository.
49
+
50
+ **Git::Log** - An Enumerable object that references all the
51
+ `Git::Object::Commit` objects that encompass your log query, which can be
52
+ constructed through methods on the `Git::Log object`,
53
+ like:
54
+
55
+ `@git.log(20).object("some_file").since("2 weeks ago").between('v2.6', 'v2.7').each { |commit| [block] }`
56
+
57
+ ## Examples
58
+
59
+ Here are a bunch of examples of how to use the Ruby/Git package.
60
+
61
+ Ruby < 1.9 will require rubygems to be loaded.
62
+
63
+ ```ruby
64
+ require 'rubygems'
65
+ ```
66
+
67
+ Require the 'git' gem.
68
+ ```ruby
69
+ require 'git'
70
+ ```
71
+
72
+ Git env config
73
+
74
+ ```ruby
75
+ Git.configure do |config|
76
+ # If you want to use a custom git binary
77
+ config.binary_path = '/git/bin/path'
78
+
79
+ # If you need to use a custom SSH script
80
+ config.git_ssh = '/path/to/ssh/script'
81
+ end
82
+
83
+ ```
84
+
85
+
86
+ Here are the operations that need read permission only.
87
+
88
+ ```ruby
89
+ g = Git.open(working_dir, :log => Logger.new(STDOUT))
90
+
91
+ g.index
92
+ g.index.readable?
93
+ g.index.writable?
94
+ g.repo
95
+ g.dir
96
+
97
+ g.log # returns array of Git::Commit objects
98
+ g.log.since('2 weeks ago')
99
+ g.log.between('v2.5', 'v2.6')
100
+ g.log.each {|l| puts l.sha }
101
+ g.gblob('v2.5:Makefile').log.since('2 weeks ago')
102
+
103
+ g.object('HEAD^').to_s # git show / git rev-parse
104
+ g.object('HEAD^').contents
105
+ g.object('v2.5:Makefile').size
106
+ g.object('v2.5:Makefile').sha
107
+
108
+ g.gtree(treeish)
109
+ g.gblob(treeish)
110
+ g.gcommit(treeish)
111
+
112
+
113
+ commit = g.gcommit('1cc8667014381')
114
+
115
+ commit.gtree
116
+ commit.parent.sha
117
+ commit.parents.size
118
+ commit.author.name
119
+ commit.author.email
120
+ commit.author.date.strftime("%m-%d-%y")
121
+ commit.committer.name
122
+ commit.date.strftime("%m-%d-%y")
123
+ commit.message
124
+
125
+ tree = g.gtree("HEAD^{tree}")
126
+
127
+ tree.blobs
128
+ tree.subtrees
129
+ tree.children # blobs and subtrees
130
+
131
+ g.revparse('v2.5:Makefile')
132
+
133
+ g.branches # returns Git::Branch objects
134
+ g.branches.local
135
+ g.branches.remote
136
+ g.branches[:master].gcommit
137
+ g.branches['origin/master'].gcommit
138
+
139
+ g.grep('hello') # implies HEAD
140
+ g.blob('v2.5:Makefile').grep('hello')
141
+ g.tag('v2.5').grep('hello', 'docs/')
142
+ g.describe()
143
+ g.describe('0djf2aa')
144
+ g.describe('HEAD', {:all => true, :tags => true})
145
+
146
+ g.diff(commit1, commit2).size
147
+ g.diff(commit1, commit2).stats
148
+ g.diff(commit1, commit2).name_status
149
+ g.gtree('v2.5').diff('v2.6').insertions
150
+ g.diff('gitsearch1', 'v2.5').path('lib/')
151
+ g.diff('gitsearch1', @git.gtree('v2.5'))
152
+ g.diff('gitsearch1', 'v2.5').path('docs/').patch
153
+ g.gtree('v2.5').diff('v2.6').patch
154
+
155
+ g.gtree('v2.5').diff('v2.6').each do |file_diff|
156
+ puts file_diff.path
157
+ puts file_diff.patch
158
+ puts file_diff.blob(:src).contents
159
+ end
160
+
161
+ g.config('user.name') # returns 'Scott Chacon'
162
+ g.config # returns whole config hash
163
+
164
+ g.tags # returns array of Git::Tag objects
165
+
166
+ g.show()
167
+ g.show('HEAD')
168
+ g.show('v2.8', 'README.md')
169
+
170
+ # returns a hash containing the available references of the repo.
171
+ Git.ls_remote('https://github.com/zedtux/ruby-git-ce.git')
172
+ Git.ls_remote('/path/to/local/repo')
173
+ Git.ls_remote() # same as Git.ls_remote('.')
174
+
175
+ ```
176
+
177
+ And here are the operations that will need to write to your git repository.
178
+
179
+ ```ruby
180
+ g = Git.init
181
+ Git.init('project')
182
+ Git.init('/home/schacon/proj',
183
+ { :repository => '/opt/git/proj.git',
184
+ :index => '/tmp/index'} )
185
+
186
+ g = Git.clone(URI, NAME, :path => '/tmp/checkout')
187
+ g.config('user.name', 'Scott Chacon')
188
+ g.config('user.email', 'email@email.com')
189
+
190
+ g.add # git add -- "."
191
+ g.add(:all=>true) # git add --all -- "."
192
+ g.add('file_path') # git add -- "file_path"
193
+ g.add(['file_path_1', 'file_path_2']) # git add -- "file_path_1" "file_path_2"
194
+
195
+ g.remove() # git rm -f -- "."
196
+ g.remove('file.txt') # git rm -f -- "file.txt"
197
+ g.remove(['file.txt', 'file2.txt']) # git rm -f -- "file.txt" "file2.txt"
198
+ g.remove('file.txt', :recursive => true) # git rm -f -r -- "file.txt"
199
+ g.remove('file.txt', :cached => true) # git rm -f --cached -- "file.txt"
200
+
201
+ g.commit('message')
202
+ g.commit_all('message')
203
+
204
+ g = Git.clone(repo, 'myrepo')
205
+ g.chdir do
206
+ new_file('test-file', 'blahblahblah')
207
+ g.status.changed.each do |file|
208
+ puts file.blob(:index).contents
209
+ end
210
+ end
211
+
212
+ g.reset # defaults to HEAD
213
+ g.reset_hard(Git::Commit)
214
+
215
+ g.branch('new_branch') # creates new or fetches existing
216
+ g.branch('new_branch').checkout
217
+ g.branch('new_branch').delete
218
+ g.branch('existing_branch').checkout
219
+ g.branch('master').contains?('existing_branch')
220
+
221
+ g.checkout('new_branch')
222
+ g.checkout(g.branch('new_branch'))
223
+
224
+ g.branch(name).merge(branch2)
225
+ g.branch(branch2).merge # merges HEAD with branch2
226
+
227
+ g.branch(name).in_branch(message) { # add files } # auto-commits
228
+ g.merge('new_branch')
229
+ g.merge('origin/remote_branch')
230
+ g.merge(g.branch('master'))
231
+ g.merge([branch1, branch2])
232
+
233
+ r = g.add_remote(name, uri) # Git::Remote
234
+ r = g.add_remote(name, Git::Base) # Git::Remote
235
+
236
+ g.remotes # array of Git::Remotes
237
+ g.remote(name).fetch
238
+ g.remote(name).remove
239
+ g.remote(name).merge
240
+ g.remote(name).merge(branch)
241
+
242
+ g.fetch
243
+ g.fetch(g.remotes.first)
244
+ g.fetch('origin', {:ref => 'some/ref/head'} )
245
+
246
+ g.pull
247
+ g.pull(Git::Repo, Git::Branch) # fetch and a merge
248
+
249
+ g.add_tag('tag_name') # returns Git::Tag
250
+ g.add_tag('tag_name', 'object_reference')
251
+ g.add_tag('tag_name', 'object_reference', {:options => 'here'})
252
+ g.add_tag('tag_name', {:options => 'here'})
253
+
254
+ Options:
255
+ :a | :annotate
256
+ :d
257
+ :f
258
+ :m | :message
259
+ :s
260
+
261
+ g.delete_tag('tag_name')
262
+
263
+ g.repack
264
+
265
+ g.push
266
+ g.push(g.remote('name'))
267
+ ```
268
+
269
+ Some examples of more low-level index and tree operations
270
+
271
+ ```ruby
272
+ g.with_temp_index do
273
+
274
+ g.read_tree(tree3) # calls self.index.read_tree
275
+ g.read_tree(tree1, :prefix => 'hi/')
276
+
277
+ c = g.commit_tree('message')
278
+ # or #
279
+ t = g.write_tree
280
+ c = g.commit_tree(t, :message => 'message', :parents => [sha1, sha2])
281
+
282
+ g.branch('branch_name').update_ref(c)
283
+ g.update_ref(branch, c)
284
+
285
+ g.with_temp_working do # new blank working directory
286
+ g.checkout
287
+ g.checkout(another_index)
288
+ g.commit # commits to temp_index
289
+ end
290
+ end
291
+
292
+ g.set_index('/path/to/index')
293
+
294
+
295
+ g.with_index(path) do
296
+ # calls set_index, then switches back after
297
+ end
298
+
299
+ g.with_working(dir) do
300
+ # calls set_working, then switches back after
301
+ end
302
+
303
+ g.with_temp_working(dir) do
304
+ g.checkout_index(:prefix => dir, :path_limiter => path)
305
+ # do file work
306
+ g.commit # commits to index
307
+ end
308
+ ```
309
+
310
+ ## License
311
+
312
+ licensed under MIT License Copyright (c) 2008 Scott Chacon. See LICENSE for
313
+ further details.
data/lib/git/author.rb ADDED
@@ -0,0 +1,14 @@
1
+ module Git
2
+ class Author
3
+ attr_accessor :name, :email, :date
4
+
5
+ def initialize(author_string)
6
+ if m = /(.*?) <(.*?)> (\d+) (.*)/.match(author_string)
7
+ @name = m[1]
8
+ @email = m[2]
9
+ @date = Time.at(m[3].to_i)
10
+ end
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,75 @@
1
+ module Git
2
+
3
+ class Base
4
+
5
+ module Factory
6
+
7
+ # returns a Git::Branch object for branch_name
8
+ def branch(branch_name = 'master')
9
+ Git::Branch.new(self, branch_name)
10
+ end
11
+
12
+ # returns a Git::Branches object of all the Git::Branch
13
+ # objects for this repo
14
+ def branches
15
+ Git::Branches.new(self)
16
+ end
17
+
18
+ def commit_tree(tree = nil, opts = {})
19
+ Git::Object::Commit.new(self, self.lib.commit_tree(tree, opts))
20
+ end
21
+
22
+ # returns a Git::Diff object
23
+ def diff(objectish = 'HEAD', obj2 = nil)
24
+ Git::Diff.new(self, objectish, obj2)
25
+ end
26
+
27
+ def gblob(objectish)
28
+ Git::Object.new(self, objectish, 'blob')
29
+ end
30
+
31
+ def gcommit(objectish)
32
+ Git::Object.new(self, objectish, 'commit')
33
+ end
34
+
35
+ def gtree(objectish)
36
+ Git::Object.new(self, objectish, 'tree')
37
+ end
38
+
39
+ # returns a Git::Log object with count commits
40
+ def log(count = 30)
41
+ Git::Log.new(self, count)
42
+ end
43
+
44
+ # returns a Git::Object of the appropriate type
45
+ # you can also call @git.gtree('tree'), but that's
46
+ # just for readability. If you call @git.gtree('HEAD') it will
47
+ # still return a Git::Object::Commit object.
48
+ #
49
+ # @git.object calls a factory method that will run a rev-parse
50
+ # on the objectish and determine the type of the object and return
51
+ # an appropriate object for that type
52
+ def object(objectish)
53
+ Git::Object.new(self, objectish)
54
+ end
55
+
56
+ # returns a Git::Remote object
57
+ def remote(remote_name = 'origin')
58
+ Git::Remote.new(self, remote_name)
59
+ end
60
+
61
+ # returns a Git::Status object
62
+ def status
63
+ Git::Status.new(self)
64
+ end
65
+
66
+ # returns a Git::Tag object
67
+ def tag(tag_name)
68
+ Git::Object.new(self, tag_name, 'tag', true)
69
+ end
70
+
71
+ end
72
+
73
+ end
74
+
75
+ end