diff --git a/pagure/lib/git.py b/pagure/lib/git.py
index 7328874..b72ad41 100644
--- a/pagure/lib/git.py
+++ b/pagure/lib/git.py
@@ -201,10 +201,7 @@ def _update_git(obj, repo, repofolder):
diff = new_repo.diff()
files = []
for patch in diff:
- if hasattr(patch, 'new_file_path'):
- files.append(patch.new_file_path)
- elif hasattr(patch, 'delta'):
- files.append(patch.delta.new_file.path)
+ files.append(patch.delta.new_file.path)
# Add the changes to the index
if added:
@@ -905,9 +902,6 @@ def _update_file_in_git(
diff = new_repo.diff()
files = []
for patch in diff:
- if hasattr(patch, 'new_file_path'):
- files.append(patch.new_file_path)
- elif hasattr(patch, 'delta'):
files.append(patch.delta.new_file.path)
# Add the changes to the index
diff --git a/pagure/templates/commit.html b/pagure/templates/commit.html
index c3c93ab..86be630 100644
--- a/pagure/templates/commit.html
+++ b/pagure/templates/commit.html
@@ -88,23 +88,10 @@
{% set filecount = 0 %}
{% for patch in diff %}
{% set filecount = filecount + 1 %}
- {% if patch | hasattr('new_file_path') %}
-
- {{ patch.new_file_path | unicode}}
- {% elif patch | hasattr('delta') %}
{{ patch.delta.new_file.path | unicode }}
- {% endif %}