Skip to content

Commit 8340c0b

Browse files
committed
Fixed diff function. Moved from GitCommand to Git.
1 parent d3923ce commit 8340c0b

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

Project.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Reproduce"
22
uuid = "560a9c3a-0b8c-11e9-0329-d39dfcb85ed2"
33
authors = ["Matt <[email protected]>"]
4-
version = "0.8.2"
4+
version = "0.8.3"
55

66
[deps]
77
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
@@ -10,7 +10,7 @@ CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
1010
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
1111
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
1212
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
13-
GitCommand = "49b5b516-ca3f-4003-a081-42bdcf55082d"
13+
Git = "d7ba0133-e1db-5d97-8f8c-041e4b3a1eb2"
1414
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
1515
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
1616
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
@@ -27,7 +27,7 @@ ArgParse = "0.6, 1"
2727
BSON = "0.2, 0.3"
2828
CodeTracking = "0.5, 1"
2929
FileIO = "1"
30-
GitCommand = "2, 3"
30+
Git = "1"
3131
HDF5 = "0.12, 0.13, 0.14, 0.15"
3232
JLD2 = "0.1, 0.2, 0.3, 0.4"
3333
JSON = "0.20, 0.21"

src/Reproduce.jl

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11

22
module Reproduce
33

4-
import GitCommand
4+
import Git
55

66
function git_head()
7-
s = ""
8-
GitCommand.git() do git
9-
s = read(`$git rev-parse HEAD`, String)
10-
end
7+
s = read(`$(Git.git()) rev-parse HEAD`, String)
118
s[1:end-1]
129
end
1310

1411
function git_branch()
15-
s = ""
16-
GitCommand.git() do git
17-
s = read(`$git rev-parse --symbolic-full-name --abbrev-ref HEAD`, String)
18-
end
12+
s = read(`$(Git.git()) rev-parse --symbolic-full-name --abbrev-ref HEAD`, String)
1913
s[1:end-1]
2014
end
2115

src/search.jl

+5-3
Original file line numberDiff line numberDiff line change
@@ -179,25 +179,27 @@ function Base.diff(items::Array{Item, 1};
179179
kt = keytype(items[1].parsed_args)
180180
exclude_keys = kt.(exclude_keys)
181181
if exclude_parse_values == true
182-
exclude_keys = [exclude_keys; kt.([HASH_KEY, SAVE_NAME_KEY, GIT_INFO_KEY])]
182+
exclude_keys = [exclude_keys; kt.([Reproduce.HASH_KEY, Reproduce.SAVE_NAME_KEY, Reproduce.GIT_INFO_KEY])]
183183
end
184184
diff_parsed = Dict{kt, Array}()
185185
for item in items
186186
tmp_dict = items[1] - item
187187
for key in filter((k)->k exclude_keys, keys(tmp_dict))
188188
if key keys(diff_parsed)
189-
diff_parsed[key] = Array{Any, 1}()
189+
diff_parsed[key] = Array{Any, 1}()
190190
end
191+
191192
if tmp_dict[key][1] diff_parsed[key]
192193
push!(diff_parsed[key], tmp_dict[key][1])
194+
new_type = typeof(tmp_dict[key])
193195
end
194196
if tmp_dict[key][2] diff_parsed[key]
195197
push!(diff_parsed[key], tmp_dict[key][2])
196198
end
197199
end
198200
end
199201
for key in keys(diff_parsed)
200-
diff_parsed[key] = collect(promote(diff_parsed[key]...))
202+
diff_parsed[key] = collect(promote(diff_parsed[key]...))
201203
sort!(diff_parsed[key])
202204
end
203205
return diff_parsed

0 commit comments

Comments
 (0)