FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
GitPython/git/refs/remote.py at fetch_n_push · tmzullinger/GitPython · GitHub
tmzullinger
GitPython
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
GitPython
/
git
/
refs
/
remote.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (22 loc) · 787 Bytes
Breadcrumbs
GitPython
/
git
/
refs
/
remote.py
Copy path
File metadata and controls
26 lines (22 loc) · 787 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import
os
from
gitdb
.
ref
.
remote
import
RemoteReference
as
GitDB_RemoteReference
__all__
=
[
"RemoteReference"
]
class
RemoteReference
(
GitDB_RemoteReference
):
"""Represents a reference pointing to a remote head."""
__slots__
=
tuple
()
@
classmethod
def
delete
(
cls
,
repo
,
*
refs
,
**
kwargs
):
"""Delete the given remote references.
:note:
kwargs are given for compatability with the base class method as we
should not narrow the signature."""
repo
.
git
.
branch
(
"-d"
,
"-r"
,
*
refs
)
# the official deletion method will ignore remote symbolic refs - these
# are generally ignored in the refs/ folder. We don't though
# and delete remainders manually
for
ref
in
refs
:
try
:
os
.
remove
(
join
(
repo
.
git_dir
,
ref
.
path
))
except
OSError
:
pass
# END for each ref
Back
|
FazBrowse Home
|
New Git URL