diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-11 20:01:31 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-10-11 20:02:51 -0400 |
commit | d34594f65006222070deffa3efe6a78cd7f3c56a (patch) | |
tree | 203effc378946e7b1dd2da869a4b85d067008b09 /gitsrht/blueprints/repo.py | |
parent | 6db5a97fa45c5777ae7aa14b6eff19098269b24e (diff) |
Fix diff of initial commit
Diffstat (limited to 'gitsrht/blueprints/repo.py')
-rw-r--r-- | gitsrht/blueprints/repo.py | 3 |
1 files changed, 2 insertions, 1 deletions
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", |