gitlab_git 10.6.7 → 10.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/gitlab_git/compare.rb +4 -2
- data/lib/gitlab_git/diff.rb +14 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0988bb5a3617f4bac08f53781bea813be09c7a9
|
4
|
+
data.tar.gz: 0ce71e0cf618cf267c0b2ef057cb6153026b6274
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 241ab6732a48d690d39a71d57d8bc311fa7ea7dc5b6fe992fb71ea1e31b407166203c16ebb48762a688933c0a014d92c4138ac1d3abbdaab46e2ecda80f20be6
|
7
|
+
data.tar.gz: 904a3b9e9f1c2ded3568c3fbd697bbda11f3c2b20c0fe903bdfeb9cdcd1a89cf386f96c0c6a20dcf4080638798961b6a7b36235e70d5ae94bd00b3c6521d75c5
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
10.6.
|
1
|
+
10.6.8
|
data/lib/gitlab_git/compare.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
module Gitlab
|
2
2
|
module Git
|
3
3
|
class Compare
|
4
|
-
attr_reader :head, :base
|
4
|
+
attr_reader :head, :base, :straight
|
5
5
|
|
6
|
-
def initialize(repository, base, head)
|
6
|
+
def initialize(repository, base, head, straight = false)
|
7
7
|
@repository = repository
|
8
|
+
@straight = straight
|
8
9
|
|
9
10
|
unless base && head
|
10
11
|
@commits = []
|
@@ -34,6 +35,7 @@ module Gitlab
|
|
34
35
|
end
|
35
36
|
|
36
37
|
paths = options.delete(:paths) || []
|
38
|
+
options[:straight] = @straight
|
37
39
|
Gitlab::Git::Diff.between(@repository, @head.id, @base.id, options, *paths)
|
38
40
|
end
|
39
41
|
end
|
data/lib/gitlab_git/diff.rb
CHANGED
@@ -21,13 +21,22 @@ module Gitlab
|
|
21
21
|
|
22
22
|
class << self
|
23
23
|
def between(repo, head, base, options = {}, *paths)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
straight = options.delete(:straight) || false
|
25
|
+
|
26
|
+
common_commit = if straight
|
27
|
+
base
|
28
|
+
else
|
29
|
+
# Only show what is new in the source branch
|
30
|
+
# compared to the target branch, not the other way
|
31
|
+
# around. The linex below with merge_base is
|
32
|
+
# equivalent to diff with three dots (git diff
|
33
|
+
# branch1...branch2) From the git documentation:
|
34
|
+
# "git diff A...B" is equivalent to "git diff
|
35
|
+
# $(git-merge-base A B) B"
|
36
|
+
repo.merge_base_commit(head, base)
|
37
|
+
end
|
28
38
|
|
29
39
|
options ||= {}
|
30
|
-
break_rewrites = options[:break_rewrites]
|
31
40
|
actual_options = filter_diff_options(options)
|
32
41
|
repo.diff(common_commit, head, actual_options, *paths)
|
33
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab_git
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.6.
|
4
|
+
version: 10.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitriy Zaporozhets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: github-linguist
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
128
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.
|
129
|
+
rubygems_version: 2.4.8
|
130
130
|
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: Gitlab::Git library
|