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
1391ce20
Commit
1391ce20
authored
Feb 07, 2018
by
Guilhem Saurel
Browse files
fix fetch
parent
80646a8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
1391ce20
...
...
@@ -340,13 +340,13 @@ class Repo(TimeStampedModel):
return
git_repo
.
create_remote
(
remote
,
self
.
get_clone_url
())
def
fetch
(
self
):
git
=
self
.
git
()
logger
.
info
(
f
'fetching
{
self
.
forge
}
-
{
self
.
namespace
}
'
)
git
_repo
=
self
.
git
()
logger
.
debug
(
f
'fetching
{
self
.
forge
}
/
{
self
.
namespace
}
/
{
self
.
project
}
'
)
try
:
git
.
fetch
()
git
_repo
.
fetch
()
except
git
.
exc
.
GitCommandError
:
logger
.
warning
(
f
'fetching
{
self
.
forge
}
-
{
self
.
namespace
}
- SECOND TRY'
)
git
.
fetch
()
logger
.
warning
(
f
'fetching
{
self
.
forge
}
/
{
self
.
namespace
}
/
{
self
.
project
}
- SECOND TRY'
)
git
_repo
.
fetch
()
def
main_branch
(
self
):
return
self
.
project
.
branch_set
.
get
(
name
=
f
'
{
self
.
git_remote
()
}
/
{
self
.
default_branch
}
'
)
...
...
@@ -449,9 +449,9 @@ class Branch(TimeStampedModel):
def
update
(
self
,
pull
=
True
):
if
pull
:
self
.
project
.
main_
repo
()
.
fetch
()
if
self
.
name
not
in
MAIN_BRANCHES
:
self
.
repo
.
fetch
()
self
.
repo
.
fetch
()
if
self
.
repo
!=
self
.
project
.
main_repo
()
:
self
.
project
.
main_
repo
()
.
fetch
()
main_branch
=
self
.
project
.
main_branch
()
if
main_branch
is
not
None
:
self
.
ahead
=
self
.
get_ahead
(
main_branch
)
...
...
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