public
Rubygem
Fork of mojombo/grit
Description: Grit is a Ruby library for extracting information from a git repository in an object oriented manner - this fork tries to intergrate as much pure-ruby functionality as possible
Homepage: http://grit.rubyforge.org/
Clone URL: git://github.com/schacon/grit.git
pulled in changes from github
schacon (author)
Tue Jul 08 20:32:35 -0700 2008
commit  c7f1990597b63aeded4f81ebd3fb29e0aded5606
tree    e8177906af2487234fc54f3517aa06a90521870e
parent  a92a84f8cafa92ad576b2c9622bf48163b6afea4
...
2
3
4
 
...
2
3
4
5
0
@@ -2,3 +2,4 @@ coverage
0
 pkg/*.tgz
0
 doc
0
 test/specifics.rb
0
+test.rb
...
36
37
38
39
 
40
41
42
...
84
85
86
87
 
88
89
90
...
93
94
95
96
 
97
 
 
98
99
100
...
102
103
104
 
 
 
 
105
106
107
...
117
118
119
 
 
 
120
121
122
...
36
37
38
 
39
40
41
42
...
84
85
86
 
87
88
89
90
...
93
94
95
 
96
97
98
99
100
101
102
...
104
105
106
107
108
109
110
111
112
113
...
123
124
125
126
127
128
129
130
131
0
@@ -36,7 +36,7 @@ module Grit
0
     end
0
     
0
     def id_abbrev
0
-      @id_abbrev ||= @repo.git.rev_parse({:short => true}, self.id).chomp
0
+      @id_abbrev ||= @repo.git.rev_parse({}, self.id).chomp[0, 7]
0
     end
0
     
0
     # Create an unbaked Commit containing just the specified attributes
0
@@ -84,7 +84,7 @@ module Grit
0
     # Returns Grit::Commit[] (baked)
0
     def self.find_all(repo, ref, options = {})
0
       allowed_options = [:max_count, :skip, :since]
0
-      
0
+          
0
       default_options = {:pretty => "raw"}
0
       actual_options = default_options.merge(options)
0
       
0
@@ -93,8 +93,10 @@ module Grit
0
       else
0
         output = repo.git.rev_list(actual_options.merge(:all => true))
0
       end
0
-      
0
+            
0
       self.list_from_string(repo, output)
0
+    rescue Grit::GitRuby::Repository::NoSuchShaFound
0
+      []
0
     end
0
     
0
     # Parse out commit information into an array of baked Commit objects
0
@@ -102,6 +104,10 @@ module Grit
0
     #   +text+ is the text output from the git command (raw format)
0
     #
0
     # Returns Grit::Commit[] (baked)
0
+    #
0
+    # really should re-write this to be more accepting of non-standard commit messages
0
+    # - it broke when 'encoding' was introduced - not sure what else might show up
0
+    #
0
     def self.list_from_string(repo, text)
0
       lines = text.split("\n")
0
       
0
@@ -117,6 +123,9 @@ module Grit
0
         author, authored_date = self.actor(lines.shift)
0
         committer, committed_date = self.actor(lines.shift)
0
         
0
+        # not doing anything with this yet, but it's sometimes there
0
+        encoding = lines.shift.split.last if lines.first =~ /^encoding/
0
+        
0
         lines.shift
0
         
0
         message_lines = []
...
16
17
18
19
 
20
21
22
...
28
29
30
31
 
32
33
34
...
44
45
46
47
 
 
 
 
 
 
48
49
50
...
67
68
69
70
 
 
 
 
 
 
 
 
 
 
 
71
72
73
74
 
75
76
77
78
 
79
80
81
82
 
83
84
85
...
101
102
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
105
106
...
16
17
18
 
19
20
21
22
...
28
29
30
 
31
32
33
34
...
44
45
46
 
47
48
49
50
51
52
53
54
55
...
72
73
74
 
75
76
77
78
79
80
81
82
83
84
85
86
87
88
 
89
90
91
92
 
93
94
95
96
 
97
98
99
100
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
0
@@ -16,7 +16,7 @@ module Grit
0
       elsif options[:s]
0
         file_size(ref)
0
       elsif options[:p]
0
-        ruby_git.cat_file(ref)
0
+        try_run { ruby_git.cat_file(ref) }
0
       end
0
     end
0
     
0
@@ -28,7 +28,7 @@ module Grit
0
 
0
     # git diff --full-index 'ec037431382e83c3e95d4f2b3d145afbac8ea55d' 'f1ec1aea10986159456846b8a05615b87828d6c6'
0
     def diff(options, sha1, sha2)
0
-      ruby_git.diff(sha1, sha2, options)
0
+      try_run { ruby_git.diff(sha1, sha2, options) }
0
     end
0
     
0
     def rev_list(options, ref = 'master')
0
@@ -44,7 +44,12 @@ module Grit
0
           return method_missing('rev-list', options, ref) 
0
         end
0
       else
0
-        return ruby_git.rev_list(rev_parse({}, ref), options)      
0
+        aref = rev_parse({}, ref)
0
+        if aref.is_a? Array
0
+          return method_missing('rev-list', options, ref) 
0
+        else
0
+          return try_run { ruby_git.rev_list(aref, options) }
0
+        end
0
       end
0
     end
0
     
0
@@ -67,19 +72,29 @@ module Grit
0
       head = File.join(@git_dir, 'refs', 'tags', string)
0
       return File.read(head).chomp if File.file?(head)
0
       
0
-      ## !! check packed-refs file, too !! 
0
+      ## check packed-refs file, too 
0
+      packref = File.join(@git_dir, 'packed-refs')
0
+      if File.file?(packref)
0
+        File.readlines(packref).each do |line|
0
+          if m = /^(\w{40}) (.*?)$/.match(line)
0
+            next if !Regexp.new(string + '$').match(m[2])
0
+            return m[1].chomp
0
+          end
0
+        end
0
+      end
0
+      
0
       ## !! more - partials and such !!
0
       
0
       # revert to calling git - grr
0
-      return method_missing('rev-parse', {}, string)
0
+      return method_missing('rev-parse', {}, string).chomp
0
     end
0
     
0
     def file_size(ref)
0
-      ruby_git.cat_file_size(ref).to_s
0
+      try_run { ruby_git.cat_file_size(ref).to_s }
0
     end
0
     
0
     def file_type(ref)
0
-      ruby_git.cat_file_type(ref)
0
+      try_run { ruby_git.cat_file_type(ref).to_s }
0
     end
0
     
0
     def blame_tree(commit, path = nil)
0
@@ -101,6 +116,26 @@ module Grit
0
     
0
     private
0
     
0
+      def try_run
0
+        ret = ''
0
+        Timeout.timeout(self.class.git_timeout) do
0
+          ret = yield
0
+        end
0
+        @bytes_read += ret.size
0
+
0
+        #if @bytes_read > 5242880 # 5.megabytes
0
+        #  bytes = @bytes_read
0
+        #  @bytes_read = 0
0
+        #  raise Grit::Git::GitTimeout.new(command, bytes) 
0
+        #end
0
+
0
+        ret
0
+      rescue Timeout::Error => e
0
+        bytes = @bytes_read
0
+        @bytes_read = 0
0
+        raise Grit::Git::GitTimeout.new(command, bytes)
0
+      end
0
+    
0
       def looking_for(commit, path = nil)
0
         tree_sha = ruby_git.get_subtree(rev_parse({}, commit), path)
0
 
...
14
15
16
17
18
19
20
21
 
 
 
22
23
24
...
45
46
47
 
 
48
49
50
...
61
62
63
64
 
 
 
 
 
65
66
67
...
109
110
111
 
112
113
114
...
116
117
118
 
119
120
121
...
14
15
16
 
17
18
19
20
21
22
23
24
25
26
...
47
48
49
50
51
52
53
54
...
65
66
67
 
68
69
70
71
72
73
74
75
...
117
118
119
120
121
122
123
...
125
126
127
128
129
130
131
0
@@ -14,11 +14,13 @@
0
 module Grit
0
   module GitRuby
0
 
0
-  # class for author/committer/tagger lines
0
   class FileIndex
0
     
0
     class IndexFileNotFound < StandardError
0
     end
0
+
0
+    class UnsupportedRef < StandardError
0
+    end
0
     
0
     attr_reader :files
0
     
0
@@ -45,6 +47,8 @@ module Grit
0
     end
0
     
0
     def commits_from(commit_sha)
0
+      raise UnsupportedRef if commit_sha.is_a? Array
0
+      
0
       already = {}
0
       final = []
0
       left_to_do = [commit_sha]
0
@@ -61,7 +65,11 @@ module Grit
0
         end if commit
0
       end
0
 
0
-      final
0
+      sort_commits(final)
0
+    end
0
+    
0
+    def sort_commits(sha_array)
0
+      sha_array.sort { |a, b| @commit_order[b] <=> @commit_order[a] }
0
     end
0
     
0
     # returns files changed at commit sha
0
@@ -109,6 +117,7 @@ module Grit
0
         f = File.new(@index_file)
0
         @sha_count = 0
0
         @commit_index = {}
0
+        @commit_order = {}
0
         @all_files = {}
0
         while line = f.gets
0
           if /^(\w{40})/.match(line)
0
@@ -116,6 +125,7 @@ module Grit
0
             current_sha = shas.shift.first
0
             parents = shas.map { |sha| sha.first }
0
             @commit_index[current_sha] = {:files => [], :parents => parents }
0
+            @commit_order[current_sha] = @sha_count
0
             @sha_count += 1
0
           else
0
             file_name = line.chomp
...
11
12
13
14
 
15
16
17
...
28
29
30
 
 
 
31
32
33
...
96
97
98
99
 
100
101
102
...
149
150
151
152
 
153
154
155
...
176
177
178
 
 
 
179
180
181
...
192
193
194
 
195
196
197
...
208
209
210
 
211
212
213
...
264
265
266
267
 
268
269
270
...
282
283
284
285
 
286
287
 
 
 
 
 
 
288
289
290
...
347
348
349
 
350
 
351
352
353
...
362
363
364
365
 
366
367
368
...
402
403
404
 
 
405
406
407
...
418
419
420
421
 
422
423
424
...
430
431
432
433
 
434
435
 
436
437
438
...
453
454
455
456
 
457
458
459
...
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
 
 
 
 
 
 
 
 
 
601
602
 
603
604
 
 
 
 
 
 
 
 
 
 
 
 
 
 
605
606
607
...
11
12
13
 
14
15
16
17
...
28
29
30
31
32
33
34
35
36
...
99
100
101
 
102
103
104
105
...
152
153
154
 
155
156
157
158
...
179
180
181
182
183
184
185
186
187
...
198
199
200
201
202
203
204
...
215
216
217
218
219
220
221
...
272
273
274
 
275
276
277
278
...
290
291
292
 
293
294
 
295
296
297
298
299
300
301
302
303
...
360
361
362
363
364
365
366
367
368
...
377
378
379
 
380
381
382
383
...
417
418
419
420
421
422
423
424
...
435
436
437
 
438
439
440
441
...
447
448
449
 
450
451
 
452
453
454
455
...
470
471
472
 
473
474
475
476
...
602
603
604
 
605
 
 
 
 
 
 
 
 
 
 
 
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
0
@@ -11,7 +11,7 @@
0
 require 'grit/git-ruby/internal/raw_object'
0
 require 'grit/git-ruby/internal/pack'
0
 require 'grit/git-ruby/internal/loose'
0
-require 'grit/git-ruby/object'
0
+require 'grit/git-ruby/git_object'
0
 
0
 require 'rubygems'
0
 require 'diff/lcs'
0
@@ -28,6 +28,9 @@ module Grit
0
       
0
       class NoSuchShaFound < StandardError
0
       end
0
+
0
+      class NoSuchPath < StandardError
0
+      end
0
       
0
       attr_accessor :git_dir, :options
0
       
0
@@ -96,7 +99,7 @@ module Grit
0
       def get_object_by_sha1(sha1)
0
         r = get_raw_object_by_sha1(sha1)
0
         return nil if !r
0
-        Object.from_raw(r)
0
+        GitObject.from_raw(r)
0
       end
0
       
0
       # writes a raw object into the git repo
0
@@ -149,7 +152,7 @@ module Grit
0
       # ['blob']['FILENAME'] = {:mode => '100644', :sha => SHA}
0
       # ['tree']['DIRNAME'] = {:mode => '040000', :sha => SHA}
0
       def list_tree(sha)        
0
-        data = {'blob' => {}, 'tree' => {}}
0
+        data = {'blob' => {}, 'tree' => {}, 'link' => {}, 'commit' => {}}
0
         get_object_by_sha1(sha).entry.each do |e|
0
           data[e.format_type][e.name] = {:mode => e.format_mode, :sha => e.sha1}
0
         end 
0
@@ -176,6 +179,9 @@ module Grit
0
         o = get_raw_object_by_sha1(sha)
0
         if o.type == :commit
0
           tree = cat_file(get_object_by_sha1(sha).tree)
0
+        elsif o.type == :tag
0
+          commit_sha = get_object_by_sha1(sha).object
0
+          tree = cat_file(get_object_by_sha1(commit_sha).tree)
0
         else
0
           tree = cat_file(sha)
0
         end
0
@@ -192,6 +198,7 @@ module Grit
0
           if (last == '/') && (paths.size == 1)
0
             append = append ? File.join(append, paths.first) : paths.first
0
             dir_name = tree.split("\n").select { |p| p.split("\t")[1] == paths.first }.first
0
+            raise NoSuchPath if !dir_name
0
             next_sha = dir_name.split(' ')[2]
0
             tree = get_raw_tree(next_sha)
0
             tree = tree.split("\n")
0
@@ -208,6 +215,7 @@ module Grit
0
           else
0
             next_path = paths.shift
0
             dir_name = tree.split("\n").select { |p| p.split("\t")[1] == next_path }.first
0
+            raise NoSuchPath if !dir_name
0
             next_sha = dir_name.split(' ')[2]
0
             next_path = append ? File.join(append, next_path) : next_path
0
             if (last == '/')
0
@@ -264,7 +272,7 @@ module Grit
0
         
0
         log = log(sha, options)
0
         log = log.sort { |a, b| a[2] <=> b[2] }.reverse
0
-        
0
+                
0
         if end_sha
0
           log = truncate_arr(log, end_sha)
0
         end
0
@@ -282,9 +290,14 @@ module Grit
0
         @already_searched[sha] = true
0
         
0
         array = []          
0
-        if (sha)
0
+        if (sha)          
0
           o = get_raw_object_by_sha1(sha)
0
-          c = Object.from_raw(o)
0
+          if o.type == :tag
0
+            commit_sha = get_object_by_sha1(sha).object
0
+            c = get_object_by_sha1(commit_sha)
0
+          else
0
+            c = GitObject.from_raw(o)
0
+          end
0
 
0
           add_sha = true
0
           
0
@@ -347,7 +360,9 @@ module Grit
0
         else
0
           tree2 = get_object_by_sha1(commit_obj1.parent.first).tree
0
         end
0
+        
0
         qdiff = quick_diff(tree1, tree2)
0
+        
0
         qdiff.sort.each do |diff_arr|
0
           format, lines, output = :unified, 3, ''
0
           file_length_difference = 0
0
@@ -362,7 +377,7 @@ module Grit
0
           data_new = fileB.split(/\n/).map! { |e| e.chomp }
0
           
0
           diffs = Difference::LCS.diff(data_old, data_new)    
0
-          return if diffs.empty?
0
+          return '' if diffs.empty?
0
 
0
           header = 'diff --git a/' + diff_arr[0].gsub('./', '') + ' b/' + diff_arr[0].gsub('./', '')
0
           if options[:full_index]
0
@@ -402,6 +417,8 @@ module Grit
0
           patch << header + output.lstrip      
0
         end
0
         patch
0
+      rescue
0
+        '' # one of the trees was bad or lcs isn't there - no diff 
0
       end
0
       
0
       # takes 2 tree shas and recursively walks them to find out what
0
@@ -418,7 +435,7 @@ module Grit
0
          
0
          t1 = list_tree(tree1) if tree1
0
          t2 = list_tree(tree2) if tree2
0
-
0
+        
0
          # finding files that are different
0
          t1['blob'].each do |file, hsh|
0
            t2_file = t2['blob'][file] rescue nil
0
@@ -430,9 +447,9 @@ module Grit
0
            end
0
          end if t1
0
          t2['blob'].each do |file, hsh|
0
-           if !t1['blob'][file]
0
+           if !t1 || !t1['blob'][file]
0
              changed << [File.join(path, file), 'removed', nil, hsh[:sha]]
0
-           end if t1
0
+           end
0
          end if t2
0
 
0
          t1['tree'].each do |dir, hsh|
0
@@ -453,7 +470,7 @@ module Grit
0
            end
0
          end if t1
0
          t2['tree'].each do |dir, hsh|
0
-           t1_tree = t2['tree'][dir] rescue nil
0
+           t1_tree = t1['tree'][dir] rescue nil
0
            full = File.join(path, dir)
0
            if !t1_tree
0
              if recurse
0
@@ -585,23 +602,35 @@ module Grit
0
       
0
         def initpacks
0
           close
0
-          
0
           @packs = []
0
-          if f = File.exists?(git_path("objects/pack"))
0
-            Dir.open(git_path("objects/pack/")) do |dir|
0
-              dir.each do |entry|
0
-                if entry =~ /\.pack$/i
0
-                  pack = Grit::GitRuby::Internal::PackStorage.new(git_path("objects/pack/" + entry))
0
-                  if @options[:map_packfile]
0
-                    pack.cache_objects
0
-                  end
0
-                  @packs << pack
0
-                end
0
-              end
0
+          
0
+          load_packs(git_path("objects/pack"))
0
+
0
+          # load alternate packs, too
0
+          alt = git_path('objects/info/alternates')
0
+          if File.exists?(alt)
0
+            File.readlines(alt).each do |line|
0
+              full_pack = File.join(line.chomp, 'pack')
0
+              load_packs(full_pack)
0
             end
0
           end
0
+          
0
           @packs
0
         end
0
+        
0
+        def load_packs(path)
0
+          return if !File.exists?(path)
0
+           Dir.open(path) do |dir|
0
+            dir.each do |entry|
0
+              next if !(entry =~ /\.pack$/i)
0
+              pack = Grit::GitRuby::Internal::PackStorage.new(File.join(path,entry))
0
+              if @options[:map_packfile]
0
+                pack.cache_objects
0
+              end
0
+              @packs << pack
0
+            end
0
+          end
0
+        end
0
       
0
     end
0
     
...
54
55
56
57
58
59
60
61
62
63
64
65
66
...
54
55
56
 
 
 
 
 
 
 
57
58
59
0
@@ -54,13 +54,6 @@ module Grit
0
       
0
       call = "#{Git.git_binary} --git-dir='#{self.git_dir}' #{cmd.to_s.gsub(/_/, '-')} #{(opt_args + ext_args).join(' ')}"
0
       puts call if Grit.debug
0
-      
0
-      puts
0
-      puts '**'
0
-      puts call
0
-      puts '**'
0
-      puts
0
-      
0
       response = timeout ? sh(call) : wild_sh(call)
0
       puts response if Grit.debug
0
       response
...
11
12
13
14
15
 
 
 
 
 
 
 
 
 
 
 
 
 
16
17
18
...
22
23
24
25
 
26
27
28
...
11
12
13
 
 
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
...
33
34
35
 
36
37
38
39
0
@@ -11,8 +11,19 @@ module Grit
0
       # Returns Grit::Ref[] (baked)
0
       def find_all(repo, options = {})      
0
         refs = []
0
-        
0
-        Dir.chdir(repo.git.git_dir) do
0
+
0
+        Dir.chdir(repo.path) do
0
+          if File.file?('packed-refs')
0
+            File.readlines('packed-refs').each do |line|
0
+              if m = /^(\w{40}) (.*?)$/.match(line)
0
+                next if !Regexp.new('^' + prefix).match(m[2])
0
+                name = m[2].sub("#{prefix}/", '')
0
+                commit = Commit.create(repo, :id => m[1])
0
+                refs << self.new(name, commit)
0
+              end
0
+            end
0
+          end
0
+          
0
           files = Dir.glob(prefix + '/**/*')
0
           files.each do |ref|
0
             next if !File.file?(ref)
0
@@ -22,7 +33,7 @@ module Grit
0
             refs << self.new(name, commit)
0
           end
0
         end
0
-        
0
+                
0
         refs
0
       end
0
 
...
309
310
311
312
313
314
315
...
309
310
311
 
312
313
314
0
@@ -309,7 +309,6 @@ module Grit
0
 
0
     # run archive directly to a file
0
     def archive_to_file(treeish = 'master', prefix = nil, filename = 'archive.tar.gz')
0
-      Grit.debug = true
0
       options = {}
0
       options[:prefix] = prefix if prefix
0
       self.git.archive(options, treeish, "| gzip > #{filename}")
...
69
70
71
 
 
72
73
74
...
69
70
71
72
73
74
75
76
0
@@ -69,6 +69,8 @@ module Grit
0
           Tree.create(repo, :id => id, :mode => mode, :name => name)
0
         when "blob"
0
           Blob.create(repo, :id => id, :mode => mode, :name => name)
0
+        when "link"
0
+          Blob.create(repo, :id => id, :mode => mode, :name => name)
0
         when "commit"
0
           nil
0
         else
...
2
3
4
5
 
6
7
8
...
19
20
21
22
23
24
25
...
2
3
4
 
5
6
7
8
...
19
20
21
 
22
23
24
0
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/helper'
0
 
0
 class TestCommit < Test::Unit::TestCase
0
   def setup
0
-    @r = Repo.new(GRIT_REPO)
0
+    @r = Repo.new(File.join(File.dirname(__FILE__), *%w[dot_git]), :is_bare => true)
0
   end
0
   
0
   # __bake__
0
@@ -19,7 +19,6 @@ class TestCommit < Test::Unit::TestCase
0
   # short_name
0
   
0
   def test_id_abbrev
0
-    Git.any_instance.expects(:rev_parse).returns(fixture('rev_parse'))
0
     assert_equal '80f136f', @r.commit('80f136f500dfdb8c3e8abf4ae716f875f0a1b57f').id_abbrev
0
   end
0
   
...
10
11
12
13
 
14
15
16
...
10
11
12
 
13
14
15
16
0
@@ -10,7 +10,7 @@ class TestDiff < Test::Unit::TestCase
0
   def test_list_from_string_new_mode
0
     output = fixture('diff_new_mode')
0
     
0
-    diffs = Diff.list_from_string(@r, output)
0
+    diffs = Grit::Diff.list_from_string(@r, output)
0
     assert_equal 2, diffs.size
0
     assert_equal 10, diffs.first.diff.split("\n").size
0
     assert_equal nil, diffs.last.diff
...
18
19
20
 
 
 
 
 
 
 
 
 
 
21
...
18
19
20
21
22
23
24
25
26
27
28
29
30
31
0
@@ -18,4 +18,14 @@ class TestHead < Test::Unit::TestCase
0
     head = @r.heads[1]
0
     assert_equal %Q{#<Grit::Head "test/chacon">}, head.inspect
0
   end
0
+
0
+  def test_head_count
0
+    assert_equal 4, @r.heads.size
0
+  end
0
+
0
+
0
+  def test_nonpack
0
+    assert @r.heads.map { |h| h.name }.include?('nonpack')
0
+  end
0
+
0
 end
...
42
43
44
45
46
 
47
48
 
49
50
 
51
52
53
...
182
183
184
185
 
186
187
188
189
190
191
 
192
193
194
...
42
43
44
 
 
45
46
 
47
48
 
49
50
51
52
...
181
182
183
 
184
185
186
187
188
189
 
190
191
192
193
0
@@ -42,12 +42,11 @@ class TestRepo < Test::Unit::TestCase
0
   end
0
 
0
   def test_heads_should_populate_head_data
0
-    Git.any_instance.expects(:for_each_ref).returns(fixture('for_each_ref'))
0
-
0
+    @r = Repo.new(File.join(File.dirname(__FILE__), *%w[dot_git]), :is_bare => true)
0
     head = @r.heads.first
0
-
0
+    
0
     assert_equal 'master', head.name
0
-    assert_equal '634396b2f541a9f2d58b00be1a07f0c358b999b3', head.commit.id
0
+    assert_equal 'ca8a30f5a7f0f163bbe3b6f0abf18a6c83b0687a', head.commit.id
0
   end
0
 
0
   # branches
0
@@ -182,13 +181,13 @@ class TestRepo < Test::Unit::TestCase
0
   # archive
0
 
0
   def test_archive_tar
0
-    @r.archive_tar
0
+    #@r.archive_tar  -- no assertion being done here
0
   end
0
 
0
   # archive_tar_gz
0
 
0
   def test_archive_tar_gz
0
-    @r.archive_tar_gz
0
+    #@r.archive_tar_gz -- again, no assertion
0
   end
0
 
0
   # enable_daemon_serve
...
110
111
112
113
 
114
115
116
...
110
111
112
 
113
114
115
116
0
@@ -110,7 +110,7 @@ class TestRubyGit < Test::Unit::TestCase
0
   def test_rev_list_range
0
     range = '30e367cef2203eba2b341dc9050993b06fd1e108..3fa4e130fa18c92e3030d4accb5d3e0cadd40157'
0
     out = @git.rev_list({}, range)
0
-    assert_equal out, fixture('rev_list_range').chomp
0
+    assert_equal fixture('rev_list_range'), out
0
   end
0
 
0
   def test_ls_tree_paths_multi

Comments