From 4a742055c29925484533c6e0b57690903ce3f493 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli <zack@upsilon.cc> Date: Tue, 8 Oct 2019 09:52:58 +0200 Subject: [PATCH] swh identify -t snapshot: add support for symbolic refs --- swh/model/cli.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/swh/model/cli.py b/swh/model/cli.py index 991bc46e..ec33310b 100644 --- a/swh/model/cli.py +++ b/swh/model/cli.py @@ -69,6 +69,13 @@ def pid_of_git_repo(path): } 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', -- GitLab