Diff between b9b2fe3f354b731c8556009920e281054161910f and 6ecf1d655271b263e3b5f73e8d4575acf3bfdbf8

Changed Files

File Additions Deletions Status
app.py +3 -3 modified
git/commit.py +3 -3 modified
templates/blob.html +1 -1 modified
templates/commit.html +1 -1 modified
templates/commits.html +1 -1 modified

Full Patch

diff --git a/app.py b/app.py
index bd06a08..3b87e76 100644
--- a/app.py
+++ b/app.py
@@ -30,9 +30,9 @@ def repo_commits(repo_name):
     has_prev = page > 0
     return render_template("commits.html", repo_name=repo_name, commits=commits, page=page, has_next=has_next, has_prev=has_prev, ref=ref)
 
-@app.route("/<repo_name>/commits/<commit_hash>")
-def commit_detail(repo_name, commit_hash):
-    commit = get_commit(f"{repo_path}/{repo_name}", commit_hash)
+@app.route("/<repo_name>/commits/<commit_id>")
+def commit_detail(repo_name, commit_id):
+    commit = get_commit(f"{repo_path}/{repo_name}", commit_id)
     return render_template("commit.html", repo_name=repo_name, commit=commit)
 
 @app.route("/<repo_name>/refs")
diff --git a/git/commit.py b/git/commit.py
index 7fe001f..1c13bf5 100644
--- a/git/commit.py
+++ b/git/commit.py
@@ -43,10 +43,10 @@ def get_commits(path, ref="HEAD", max_count=None, skip=0):
         n += 1
     return commits
 
-# retrieves a single commit by its hash
-def get_commit(path, commit_hash):
+# retrieves a single commit by its id
+def get_commit(path, commit_id):
     repo = git.Repository(path)
-    commit = repo.revparse_single(commit_hash)
+    commit = repo.revparse_single(commit_id)
 
     if len(commit.parents) > 0:
         diff = repo.diff(commit.parents[0], commit)
diff --git a/templates/blob.html b/templates/blob.html
index 72352fc..d80ae27 100644
--- a/templates/blob.html
+++ b/templates/blob.html
@@ -1,6 +1,6 @@
 {% block content %}
 <h1>Blob: {{ blob.name }}</h1>
-<p>Blob hash: {{ blob.id }}</p>
+<p>Blob id: {{ blob.id }}</p>
 <p>Size: {{ blob.size }} bytes</p>
 <h2>Content:</h2>
 {% if blob.is_binary %}
diff --git a/templates/commit.html b/templates/commit.html
index af298ae..cec9e77 100644
--- a/templates/commit.html
+++ b/templates/commit.html
@@ -5,7 +5,7 @@
     <p>Committer: {{ commit.committer.name }} &lt;{{ commit.committer.email }}&gt;</p>
     <p>Date: {{ commit.date }}</p>
     {% if commit.parent_id %}
-    <p>Parent: <a href="{{ url_for('commit_detail', repo_name=repo_name, commit_hash=commit.parent_id) }}">{{ commit.parent_id }}</a></p>
+    <p>Parent: <a href="{{ url_for('commit_detail', repo_name=repo_name, commit_id=commit.parent_id) }}">{{ commit.parent_id }}</a></p>
     {% endif %}
     <p>Tree: <a href="{{ url_for('repo_tree_path', repo_name=repo_name, path='') }}?ref={{ commit.tree_id }}">{{ commit.tree_id }}</a></p>
     <p><a href="{{ url_for('repo_tree_path', repo_name=repo_name, path='') }}?ref={{ commit.id }}">View Tree</a></p>
diff --git a/templates/commits.html b/templates/commits.html
index e9ba28a..d766dc6 100644
--- a/templates/commits.html
+++ b/templates/commits.html
@@ -4,7 +4,7 @@
     <ul>
         {% for commit in commits %}
             <li>
-            <a href="{{ url_for('commit_detail', repo_name=repo_name, commit_hash=commit.id) }}">{{ commit.id }}</a> - {{ commit.message }} - {{ commit.author.name }} - {{ commit.date }} {{ commit.diff_stats.files_changed }} files changed, {{ commit.diff_stats.insertions }} insertions, {{ commit.diff_stats.deletions }} deletions
+            <a href="{{ url_for('commit_detail', repo_name=repo_name, commit_id=commit.id) }}">{{ commit.id }}</a> - {{ commit.message }} - {{ commit.author.name }} - {{ commit.date }} {{ commit.diff_stats.files_changed }} files changed, {{ commit.diff_stats.insertions }} insertions, {{ commit.diff_stats.deletions }} deletions
             </li>
         {% endfor %}
     </ul>