Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066236
D2503.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D2503.id.diff
View Options
diff --git a/swh/indexer/origin_head.py b/swh/indexer/origin_head.py
--- a/swh/indexer/origin_head.py
+++ b/swh/indexer/origin_head.py
@@ -47,18 +47,6 @@
# could not find a head revision
return None
- # VCSs
-
- def _try_get_vcs_head(self, snapshot):
- try:
- branches = snapshot['branches']
- if branches[b'HEAD']['target_type'] == 'revision':
- return branches[b'HEAD']['target']
- except KeyError:
- return None
-
- _try_get_hg_head = _try_get_git_head = _try_get_vcs_head
-
# Tarballs
_archive_filename_re = re.compile(
@@ -113,7 +101,7 @@
# Generic
def _try_get_head_generic(self, snapshot):
- # Works on 'deposit', 'svn', and 'pypi'.
+ # Works on 'deposit', 'pypi', and VCSs.
try:
branches = snapshot['branches']
except KeyError:
diff --git a/swh/indexer/tests/utils.py b/swh/indexer/tests/utils.py
--- a/swh/indexer/tests/utils.py
+++ b/swh/indexer/tests/utils.py
@@ -66,10 +66,13 @@
'target': b'L[\xce\x1c\x88\x8eF\t\xf1"\x19\x1e\xfb\xc0'
b's\xe7/\xe9l\x1e',
'target_type': 'revision'},
- b'HEAD': {
+ b'refs/head/master': {
'target': b'8K\x12\x00d\x03\xcc\xe4]bS\xe3\x8f{\xd7}'
b'\xac\xefrm',
'target_type': 'revision'},
+ b'HEAD': {
+ 'target': b'refs/head/master',
+ 'target_type': 'alias'},
b'refs/tags/v0.0.103': {
'target': b'\xb6"Im{\xfdLb\xb0\x94N\xea\x96m\x13x\x88+'
b'\x0f\xdd',
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 5 2024, 3:30 AM (20 w, 3 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3216604
Attached To
D2503: Fix support of VCSs whose HEAD branch is an alias.
Event Timeline
Log In to Comment