Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7163819
D2081.id7363.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
D2081.id7363.diff
View Options
diff --git a/swh/model/cli.py b/swh/model/cli.py
--- a/swh/model/cli.py
+++ b/swh/model/cli.py
@@ -69,6 +69,13 @@
}
else:
branches[ref] = None
+
+ for ref, target in repo.refs.get_symrefs().items():
+ branches[ref] = {
+ 'target': target,
+ 'target_type': 'alias',
+ }
+
snapshot = {'branches': branches}
pid = pids.PersistentId(object_type='snapshot',
diff --git a/swh/model/tests/test_cli.py b/swh/model/tests/test_cli.py
--- a/swh/model/tests/test_cli.py
+++ b/swh/model/tests/test_cli.py
@@ -23,7 +23,7 @@
super().setUp()
self.runner = CliRunner()
- def assertPidOK(self, result, pid): # noqa: N802
+ def assertPidOK(self, result, pid):
self.assertEqual(result.exit_code, 0)
self.assertEqual(result.output.split()[0], pid)
@@ -56,8 +56,9 @@
repo_dir = os.path.join(d, 'sample-repo')
result = self.runner.invoke(cli.identify,
['--type', 'snapshot', repo_dir])
- self.assertPidOK(result,
- 'swh:1:snp:9dc0fc035aabe293f5faf6c362a59513454a170d') # NoQA
+ self.assertPidOK(
+ result,
+ 'swh:1:snp:abc888898124270905a0ef3c67e872ce08e7e0c1')
def test_origin_id(self):
"""identify an origin URL"""
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 30, 4:06 PM (6 d, 21 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3232593
Attached To
D2081: swh identify -t snapshot: add support for symbolic refs
Event Timeline
Log In to Comment