Skip to content

Commit ab42741

Browse files
jherlandhjemli
authored andcommitted
ui-commit: Limit diff based on path limit in qry.path
Signed-off-by: Johan Herland <[email protected]> Signed-off-by: Lars Hjemli <[email protected]>
1 parent c46e468 commit ab42741

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void blob_fn(struct cgit_context *ctx)
5151

5252
static void commit_fn(struct cgit_context *ctx)
5353
{
54-
cgit_print_commit(ctx->qry.sha1);
54+
cgit_print_commit(ctx->qry.sha1, ctx->qry.path);
5555
}
5656

5757
static void diff_fn(struct cgit_context *ctx)

ui-commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "ui-diff.h"
1313
#include "ui-log.h"
1414

15-
void cgit_print_commit(char *hex)
15+
void cgit_print_commit(char *hex, const char *prefix)
1616
{
1717
struct commit *commit, *parent;
1818
struct commitinfo *info;
@@ -117,7 +117,7 @@ void cgit_print_commit(char *hex)
117117
tmp = sha1_to_hex(commit->parents->item->object.sha1);
118118
else
119119
tmp = NULL;
120-
cgit_print_diff(ctx.qry.sha1, tmp, NULL);
120+
cgit_print_diff(ctx.qry.sha1, tmp, prefix);
121121
}
122122
cgit_free_commitinfo(info);
123123
}

ui-commit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef UI_COMMIT_H
22
#define UI_COMMIT_H
33

4-
extern void cgit_print_commit(char *hex);
4+
extern void cgit_print_commit(char *hex, const char *prefix);
55

66
#endif /* UI_COMMIT_H */

0 commit comments

Comments
 (0)