saddler-reporter-support-git 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/bin/console +0 -0
- data/bin/setup +0 -0
- data/lib/saddler/reporter/support/git/repository.rb +29 -0
- data/lib/saddler/reporter/support/git/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f7fe24ed28766a102e53119476d1e15ab8c2195
|
|
4
|
+
data.tar.gz: 172a13808496ba48e7156006feff7e46a18411a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0139464d5ee171f37e64e569cdc7993eec84c3304251f8af1998f87915bcf89ec9c4e0bb1623f1918a6661fe2892f20c1490ea0d0fe8833fac8035f1985751f9
|
|
7
|
+
data.tar.gz: 09ed5547ad5060078d8a1cabc15c5e4ef3be8f81e6b112421b6bcda6b3012f18d3b0f3237f1b853cd66396684596e7ec9cfd8623f658770f92e15fa4ef4f9342
|
data/bin/console
CHANGED
|
File without changes
|
data/bin/setup
CHANGED
|
File without changes
|
|
@@ -32,6 +32,35 @@ module Saddler
|
|
|
32
32
|
@git.object('HEAD')
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
def merging_sha
|
|
36
|
+
merging_object.sha
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# This for GitHub pull request diff file.
|
|
40
|
+
# if head is commit which already merged,
|
|
41
|
+
# head's parent objects include merging object
|
|
42
|
+
# and (master or origin/master)
|
|
43
|
+
def merging_object
|
|
44
|
+
return head unless merge_commit?(head)
|
|
45
|
+
commit = head.parents.select do |parent|
|
|
46
|
+
![master.sha, origin_master.sha].include?(parent.sha)
|
|
47
|
+
end
|
|
48
|
+
return commit.last if commit.count == 1
|
|
49
|
+
head # fallback
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def master
|
|
53
|
+
@git.object('master')
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def origin_master
|
|
57
|
+
@git.object('origin/master')
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def merge_commit?(commit)
|
|
61
|
+
commit.parents.count == 2
|
|
62
|
+
end
|
|
63
|
+
|
|
35
64
|
def push_endpoint
|
|
36
65
|
(env_push_endpoint || 'github.com').chomp('/')
|
|
37
66
|
end
|