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
Boxiang Sun
gitlab-ce
Commits
16ecd7c6
Commit
16ecd7c6
authored
Jul 03, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document Repository#keep_around
parent
3286dd7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
app/models/repository.rb
app/models/repository.rb
+8
-4
No files found.
app/models/repository.rb
View file @
16ecd7c6
...
@@ -207,6 +207,10 @@ class Repository
...
@@ -207,6 +207,10 @@ class Repository
rugged
.
references
.
exist?
(
ref
)
rugged
.
references
.
exist?
(
ref
)
end
end
# Makes sure a commit is kept around when Git garbage collection runs.
# Git GC will delete commits from the repository that are no longer in any
# branches or tags, but we want to keep some of these commits around, for
# example if they have comments or CI builds.
def
keep_around
(
sha
)
def
keep_around
(
sha
)
return
unless
sha
&&
commit
(
sha
)
return
unless
sha
&&
commit
(
sha
)
...
@@ -219,10 +223,6 @@ class Repository
...
@@ -219,10 +223,6 @@ class Repository
ref_exists?
(
keep_around_ref_name
(
sha
))
ref_exists?
(
keep_around_ref_name
(
sha
))
end
end
def
keep_around_ref_name
(
sha
)
"refs/keep-around/
#{
sha
}
"
end
def
tag_names
def
tag_names
cache
.
fetch
(
:tag_names
)
{
raw_repository
.
tag_names
}
cache
.
fetch
(
:tag_names
)
{
raw_repository
.
tag_names
}
end
end
...
@@ -1038,4 +1038,8 @@ class Repository
...
@@ -1038,4 +1038,8 @@ class Repository
def
tags_sorted_by_committed_date
def
tags_sorted_by_committed_date
tags
.
sort_by
{
|
tag
|
commit
(
tag
.
target
).
committed_date
}
tags
.
sort_by
{
|
tag
|
commit
(
tag
.
target
).
committed_date
}
end
end
def
keep_around_ref_name
(
sha
)
"refs/keep-around/
#{
sha
}
"
end
end
end
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