git-ds 0.9.4.1 → 0.9.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +1 -0
- data/lib/git-ds/repo.rb +7 -1
- data/tests/ut_repo.rb +4 -4
- metadata +3 -3
data/ChangeLog
CHANGED
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
|
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 { |
|
112
|
-
|
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) { |
|
122
|
-
|
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.
|
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: &
|
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: *
|
25
|
+
version_requirements: *19441760
|
26
26
|
description: A hierarchical datastore based on Git.
|
27
27
|
email: community@thoughtgang.org
|
28
28
|
executables: []
|