aboutsummaryrefslogtreecommitdiff
path: root/ui-patch.c
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'ui-patch.c')
-rw-r--r--ui-patch.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ui-patch.c b/ui-patch.c
index f9d2eeb..4ac03cb 100644
--- a/ui-patch.c
+++ b/ui-patch.c
@@ -6,8 +6,6 @@
* (see COPYING for full license text)
*/
-#define USE_THE_REPOSITORY_VARIABLE
-
#include "cgit.h"
#include "ui-patch.h"
#include "html.h"
@@ -33,7 +31,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
if (!new_rev)
new_rev = ctx.qry.head;
- if (repo_get_oid(the_repository, new_rev, &new_rev_oid)) {
+ if (get_oid(new_rev, &new_rev_oid)) {
cgit_print_error_page(404, "Not found",
"Bad object id: %s", new_rev);
return;
@@ -46,7 +44,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
}
if (old_rev) {
- if (repo_get_oid(the_repository, old_rev, &old_rev_oid)) {
+ if (get_oid(old_rev, &old_rev_oid)) {
cgit_print_error_page(404, "Not found",
"Bad object id: %s", old_rev);
return;
@@ -59,7 +57,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
} else if (commit->parents && commit->parents->item) {
oidcpy(&old_rev_oid, &commit->parents->item->object.oid);
} else {
- oidclr(&old_rev_oid, the_repository->hash_algo);
+ oidclr(&old_rev_oid);
}
if (is_null_oid(&old_rev_oid)) {
@@ -80,7 +78,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
"%s%n%n%w(0)%b";
}
- repo_init_revisions(the_repository, &rev, NULL);
+ init_revisions(&rev, NULL);
rev.abbrev = DEFAULT_ABBREV;
rev.verbose_header = 1;
rev.diff = 1;