summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-06-05 00:18:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-05 00:18:12 (GMT)
commit583c6a229571e1aa3bfb773427c67807ec1b8c21 (patch)
treecccec4bac43427c42b061aedb6a95e5e7c884eec /diff.c
parent711a11c301dafe84389624f009a2abfb7da5d83f (diff)
parentbd481de713cb59a57f5f988b9bc46550c954dc45 (diff)
downloadgit-583c6a229571e1aa3bfb773427c67807ec1b8c21.zip
git-583c6a229571e1aa3bfb773427c67807ec1b8c21.tar.gz
git-583c6a229571e1aa3bfb773427c67807ec1b8c21.tar.bz2
Merge branch 'js/blame-lib'
The internal logic used in "git blame" has been libified to make it easier to use by cgit. * js/blame-lib: (29 commits) blame: move entry prepend to libgit blame: move scoreboard setup to libgit blame: move scoreboard-related methods to libgit blame: move fake-commit-related methods to libgit blame: move origin-related methods to libgit blame: move core structures to header blame: create entry prepend function blame: create scoreboard setup function blame: create scoreboard init function blame: rework methods that determine 'final' commit blame: wrap blame_sort and compare_blame_final blame: move progress updates to a scoreboard callback blame: make sanity_check use a callback in scoreboard blame: move no_whole_file_rename flag to scoreboard blame: move xdl_opts flags to scoreboard blame: move show_root flag to scoreboard blame: move reverse flag to scoreboard blame: move contents_from to scoreboard blame: move copy/move thresholds to scoreboard blame: move stat counters to scoreboard ...
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 48e5f9c..5275c4b 100644
--- a/diff.c
+++ b/diff.c
@@ -5270,6 +5270,29 @@ size_t fill_textconv(struct userdiff_driver *driver,
return size;
}
+int textconv_object(const char *path,
+ unsigned mode,
+ const struct object_id *oid,
+ int oid_valid,
+ char **buf,
+ unsigned long *buf_size)
+{
+ struct diff_filespec *df;
+ struct userdiff_driver *textconv;
+
+ df = alloc_filespec(path);
+ fill_filespec(df, oid->hash, oid_valid, mode);
+ textconv = get_textconv(df);
+ if (!textconv) {
+ free_filespec(df);
+ return 0;
+ }
+
+ *buf_size = fill_textconv(textconv, df, buf);
+ free_filespec(df);
+ return 1;
+}
+
void setup_diff_pager(struct diff_options *opt)
{
/*