diff --git a/app.py b/app.py
index bd06a08..3b87e76 100644
--- a/app.py
+++ b/app.py
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
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
{% 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
<p>Committer: {{ commit.committer.name }} <{{ commit.committer.email }}></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
<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>