From d34594f65006222070deffa3efe6a78cd7f3c56a Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 11 Oct 2018 20:01:31 -0400 Subject: [PATCH] Fix diff of initial commit --- 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 c69d3dd..b5fffd0 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -289,7 +289,8 @@ def commit(owner, repo, ref): parent = git_repo.revparse_single(ref + "^") diff = git_repo.diff(parent, ref) except KeyError: - diff = ref.tree.diff_to_tree() + parent = None + diff = commit.tree.diff_to_tree(swap=True) diff.find_similar(pygit2.GIT_DIFF_FIND_RENAMES) refs = collect_refs(git_repo) return render_template("commit.html", view="log", -- 2.38.4