git-ds 0.9.4.1 → 0.9.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog CHANGED
@@ -4,3 +4,4 @@
4
4
  * Added Changelog to gemspec.
5
5
  * Removed initialize() method from Model and ModelItem modules
6
6
  * Fixed bug in Repo.top_level class method
7
+ * Added code to account for broken Grit init
data/lib/git-ds/repo.rb CHANGED
@@ -42,6 +42,12 @@ Note: StagingIndex is cached, as it is from the command line.
42
42
  # TODO: something more intelligent, e.g. with git/repo options
43
43
  def self.create(path)
44
44
  Grit::Repo.init(path)
45
+
46
+ # handle broken Grit init
47
+ if not File.exist?(path + GIT_DIR)
48
+ `git init #{path}`
49
+ end
50
+
45
51
  self.new(path) # discard Grit::Repo object and use a Repo object
46
52
  end
47
53
 
@@ -164,7 +170,7 @@ branch for all repo activity and sets HEAD.
164
170
  Merge specified branch into master.
165
171
  =end
166
172
  def merge_branch( tag=@current_branch, actor=nil )
167
- raise "Invalid branch '#{tag}'" if not (is_head? tag)
173
+ raise "Invalid branch '#{tag}'" if not is_head?(tag)
168
174
 
169
175
  tag.gsub!(/['\\]/, '')
170
176
 
data/tests/ut_repo.rb CHANGED
@@ -108,8 +108,8 @@ class TC_GitRepoTest < Test::Unit::TestCase
108
108
  assert( @repo.staging?(), 'Repo#staging returned FALSE' )
109
109
 
110
110
  path, data = 'class c/instance a/prop b', 'XXXXXXXXXX'
111
- @repo.stage { |idx|
112
- idx.add( path, data )
111
+ @repo.stage { |index|
112
+ index.add( path, data )
113
113
  }
114
114
 
115
115
  assert_equal(data, @repo.object_data(path), 'Stage did not write data')
@@ -118,8 +118,8 @@ class TC_GitRepoTest < Test::Unit::TestCase
118
118
  assert( (not @repo.staging?), 'Repo#staging returned TRUE' )
119
119
 
120
120
  msg = 'this is a test'
121
- @repo.stage_and_commit(msg) { |idx|
122
- idx.add( path, data )
121
+ @repo.stage_and_commit(msg) { |index|
122
+ index.add( path, data )
123
123
  }
124
124
 
125
125
  # ensure this doesn't screw up repo
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-ds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4.1
4
+ version: 0.9.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: grit
17
- requirement: &18089080 !ruby/object:Gem::Requirement
17
+ requirement: &19441760 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: 2.2.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *18089080
25
+ version_requirements: *19441760
26
26
  description: A hierarchical datastore based on Git.
27
27
  email: community@thoughtgang.org
28
28
  executables: []