Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
00c9c6b4
Commit
00c9c6b4
authored
Aug 03, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused methods
parent
3a8f4a34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
77 deletions
+0
-77
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+0
-77
No files found.
lib/gitlab/git/repository.rb
View file @
00c9c6b4
...
@@ -849,46 +849,6 @@ module Gitlab
...
@@ -849,46 +849,6 @@ module Gitlab
submodule_data
.
select
{
|
path
,
data
|
data
[
'id'
]
}
submodule_data
.
select
{
|
path
,
data
|
data
[
'id'
]
}
end
end
# Returns true if +commit+ introduced changes to +path+, using commit
# trees to make that determination. Uses the history simplification
# rules that `git log` uses by default, where a commit is omitted if it
# is TREESAME to any parent.
#
# If the +follow+ option is true and the file specified by +path+ was
# renamed, then the path value is set to the old path.
def
commit_touches_path?
(
commit
,
path
,
follow
,
walker
)
entry
=
tree_entry
(
commit
,
path
)
if
commit
.
parents
.
empty?
# This is the root commit, return true if it has +path+ in its tree
return
!
entry
.
nil?
end
num_treesame
=
0
commit
.
parents
.
each
do
|
parent
|
parent_entry
=
tree_entry
(
parent
,
path
)
# Only follow the first TREESAME parent for merge commits
if
num_treesame
>
0
walker
.
hide
(
parent
)
next
end
if
entry
.
nil?
&&
parent_entry
.
nil?
num_treesame
+=
1
elsif
entry
&&
parent_entry
&&
entry
[
:oid
]
==
parent_entry
[
:oid
]
num_treesame
+=
1
end
end
case
num_treesame
when
0
detect_rename
(
commit
,
commit
.
parents
.
first
,
path
)
if
follow
true
else
false
end
end
# Find the entry for +path+ in the tree for +commit+
# Find the entry for +path+ in the tree for +commit+
def
tree_entry
(
commit
,
path
)
def
tree_entry
(
commit
,
path
)
pathname
=
Pathname
.
new
(
path
)
pathname
=
Pathname
.
new
(
path
)
...
@@ -916,43 +876,6 @@ module Gitlab
...
@@ -916,43 +876,6 @@ module Gitlab
tmp_entry
tmp_entry
end
end
# Compare +commit+ and +parent+ for +path+. If +path+ is a file and was
# renamed in +commit+, then set +path+ to the old filename.
def
detect_rename
(
commit
,
parent
,
path
)
diff
=
parent
.
diff
(
commit
,
paths:
[
path
],
disable_pathspec_match:
true
)
# If +path+ is a filename, not a directory, then we should only have
# one delta. We don't need to follow renames for directories.
return
nil
if
diff
.
each_delta
.
count
>
1
delta
=
diff
.
each_delta
.
first
if
delta
.
added?
full_diff
=
parent
.
diff
(
commit
)
full_diff
.
find_similar!
full_diff
.
each_delta
do
|
full_delta
|
if
full_delta
.
renamed?
&&
path
==
full_delta
.
new_file
[
:path
]
# Look for the old path in ancestors
path
.
replace
(
full_delta
.
old_file
[
:path
])
end
end
end
end
# Returns true if the index entry has the special file mode that denotes
# a submodule.
def
submodule?
(
index_entry
)
index_entry
[
:mode
]
==
57344
end
# Return a Rugged::Index that has read from the tree at +ref_name+
def
populated_index
(
ref_name
)
commit
=
rev_parse_target
(
ref_name
)
index
=
rugged
.
index
index
.
read_tree
(
commit
.
tree
)
index
end
# Return the Rugged patches for the diff between +from+ and +to+.
# Return the Rugged patches for the diff between +from+ and +to+.
def
diff_patches
(
from
,
to
,
options
=
{},
*
paths
)
def
diff_patches
(
from
,
to
,
options
=
{},
*
paths
)
options
||=
{}
options
||=
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment