From 847d605862de02b67af23905fbd25ad5811dff13 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 26 Feb 2021 09:10:01 -0500 Subject: [PATCH] archive: decode ref name --- gitsrht/blueprints/repo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index ddddc15..dfbcddf 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -350,12 +350,13 @@ def archive(owner, repo, ref): if not isinstance(commit, pygit2.Commit): abort(404) + refname = ref.decode('utf-8', 'replace') args = [ "git", "--git-dir", repo.path, "archive", "--format=tar.gz", - "--prefix", f"{repo.name}-{ref}/", + "--prefix", f"{repo.name}-{refname}/", ref ] subp = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=sys.stderr) -- 2.38.4