Skip to content
GitLab
Menu
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
10dc2ab8
Commit
10dc2ab8
authored
Feb 24, 2020
by
Guilhem Saurel
Browse files
don't delete unexistent stuff
parent
118e227b
Pipeline
#8477
failed with stage
in 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gh/views.py
View file @
10dc2ab8
...
@@ -46,7 +46,9 @@ def push(request: HttpRequest, rep: str) -> HttpResponse:
...
@@ -46,7 +46,9 @@ def push(request: HttpRequest, rep: str) -> HttpResponse:
gh_ref
=
gh_remote
.
refs
[
ref_s
]
gh_ref
=
gh_remote
.
refs
[
ref_s
]
if
data
[
'after'
]
==
"0000000000000000000000000000000000000000"
:
if
data
[
'after'
]
==
"0000000000000000000000000000000000000000"
:
print
(
"branch deleted"
)
print
(
"branch deleted"
)
git_repo
.
delete_head
([
gh_ref_s
,
gl_ref_s
,
ref_s
],
force
=
True
)
for
ref
in
[
gh_ref_s
,
gl_ref_s
,
ref_s
]:
if
ref
in
git_repo
.
branches
:
git_repo
.
delete_head
(
ref
,
force
=
True
)
gitlab
=
Forge
.
objects
.
get
(
slug
=
'gitlab'
)
gitlab
=
Forge
.
objects
.
get
(
slug
=
'gitlab'
)
project_u
=
f
'
{
namespace
.
slug
}
/
{
project
.
slug
}
'
.
replace
(
'/'
,
'%2F'
)
project_u
=
f
'
{
namespace
.
slug
}
/
{
project
.
slug
}
'
.
replace
(
'/'
,
'%2F'
)
branch_u
=
ref_s
.
replace
(
'/'
,
'%2F'
)
branch_u
=
ref_s
.
replace
(
'/'
,
'%2F'
)
...
...
Write
Preview
Supports
Markdown
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