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
f04d94cb
Commit
f04d94cb
authored
Apr 27, 2018
by
Guilhem Saurel
Browse files
Repo.update: delete if deleted
parent
979e55ac
Pipeline
#619
passed with stages
in 1 minute and 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
f04d94cb
...
...
@@ -366,7 +366,11 @@ class Repo(TimeStampedModel):
git_repo
.
fetch
()
except
git
.
exc
.
GitCommandError
:
logger
.
warning
(
f
'fetching
{
self
.
forge
}
/
{
self
.
namespace
}
/
{
self
.
project
}
- SECOND TRY'
)
git_repo
.
fetch
()
try
:
git_repo
.
fetch
()
except
git
.
exc
.
GitCommandError
:
return
False
return
True
def
main_branch
(
self
):
return
self
.
project
.
branch_set
.
get
(
name
=
f
'
{
self
.
git_remote
()
}
/
{
self
.
default_branch
}
'
)
...
...
@@ -416,11 +420,16 @@ class Repo(TimeStampedModel):
})
def
update
(
self
,
pull
=
True
):
ok
=
True
self
.
project
.
update_tags
()
if
pull
:
self
.
fetch
()
self
.
api_update
()
self
.
get_builds
()
ok
=
self
.
fetch
()
if
ok
:
self
.
api_update
()
self
.
get_builds
()
else
:
logger
.
error
(
f
'fetching
{
self
.
forge
}
/
{
self
.
namespace
}
/
{
self
.
project
}
- NOT FOUND - DELETING'
)
logger
.
error
(
str
(
self
.
delete
()))
class
Commit
(
NamedModel
,
TimeStampedModel
):
...
...
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