Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
b0d509d3
Commit
b0d509d3
authored
Feb 11, 2019
by
Guilhem Saurel
Browse files
Project.update_repo
parent
4f988524
Pipeline
#2750
passed with stages
in 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
b0d509d3
...
...
@@ -309,11 +309,15 @@ class Project(Links, NamedModel, TimeStampedModel):
for
tag
in
self
.
git
().
tags
:
Tag
.
objects
.
get_or_create
(
name
=
str
(
tag
),
project
=
self
)
def
update_repo
(
self
):
self
.
git
().
head
.
commit
=
self
.
git
().
remotes
[
self
.
main_repo
().
git_remote
()].
refs
[
self
.
main_branch
()].
commit
def
update
(
self
,
only_main_branches
=
True
):
if
self
.
main_namespace
is
None
:
return
self
.
update_branches
(
main
=
only_main_branches
)
self
.
update_tags
()
self
.
update_repo
()
tag
=
self
.
tag_set
.
filter
(
name__startswith
=
'v'
).
last
()
# TODO: implement SQL ordering for semver
if
tag
is
not
None
:
self
.
version
=
tag
.
name
[
1
:]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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