Project

General

Profile

Defect #5771 » 5771-Allow-arbitrary-length-filenames-in-repositories-5771.patch

Patch in GIT format - Holger Just, 2010-07-05 23:03

View differences:

db/migrate/20100705164950_change_changes_path_length_limit.rb
1
class ChangeChangesPathLengthLimit < ActiveRecord::Migration
2
  def self.up
3
    change_column :changes, :path, :text, :default => "", :null => false
4
    change_column :changes, :from_path, :text
5
  end
6

  
7
  def self.down
8
    change_column :changes, :from_path, :string, :default => "", :null => false
9
    change_column :changes, :from_path, :string
10
  end
11
end
test/functional/repositories_git_controller_test.rb
50 50
      assert_response :success
51 51
      assert_template 'show'
52 52
      assert_not_nil assigns(:entries)
53
      assert_equal 6, assigns(:entries).size
53
      assert_equal 7, assigns(:entries).size
54 54
      assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
55
      assert assigns(:entries).detect {|e| e.name == 'this_is_a_really_long_and_verbose_directory_name' && e.kind == 'dir'}
55 56
      assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
56 57
      assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
57 58
      assert assigns(:entries).detect {|e| e.name == 'copied_README' && e.kind == 'file'}
test/unit/lib/redmine/scm/adapters/git_adapter_test.rb
13 13
    end
14 14

  
15 15
    def test_getting_all_revisions
16
      assert_equal 12, @adapter.revisions('',nil,nil,:all => true).length
16
      assert_equal 13, @adapter.revisions('',nil,nil,:all => true).length
17 17
    end
18 18
    
19 19
    def test_annotate
test/unit/repository_git_test.rb
34 34
      @repository.fetch_changesets
35 35
      @repository.reload
36 36
      
37
      assert_equal 12, @repository.changesets.count
38
      assert_equal 21, @repository.changes.count
37
      assert_equal 13, @repository.changesets.count
38
      assert_equal 22, @repository.changes.count
39 39
      
40 40
      commit = @repository.changesets.find(:first, :order => 'committed_on ASC')
41 41
      assert_equal "Initial import.\nThe repository contains 3 files.", commit.comments
......
57 57
      # Remove the 3 latest changesets
58 58
      @repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 3).each(&:destroy)
59 59
      @repository.reload
60
      assert_equal 9, @repository.changesets.count
60
      assert_equal 10, @repository.changesets.count
61 61
      
62 62
      @repository.fetch_changesets
63
      assert_equal 12, @repository.changesets.count
63
      assert_equal 13, @repository.changesets.count
64 64
    end
65 65
  else
66 66
    puts "Git test repository NOT FOUND. Skipping unit tests !!!"
(1-1/2)