summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0041f09)
raw | patch | inline | side by side (parent: 0041f09)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 17 Dec 2011 10:20:07 +0000 (11:20 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 18 Dec 2011 02:22:29 +0000 (18:22 -0800) |
Instead of passing the hash of a commit and then searching that
same commit in the single caller, simply pass the commit directly.
Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
same commit in the single caller, simply pass the commit directly.
Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
combine-diff.c | patch | blob | history | |
diff.h | patch | blob | history | |
log-tree.c | patch | blob | history |
diff --git a/combine-diff.c b/combine-diff.c
index cfe62303a8634cb68c5f671c147efe97a5aca273..a2e8dcf8553ff15d7cfed8f8ec4735185ec162bb 100644 (file)
--- a/combine-diff.c
+++ b/combine-diff.c
}
}
-void diff_tree_combined_merge(const unsigned char *sha1,
- int dense, struct rev_info *rev)
+void diff_tree_combined_merge(const struct commit *commit, int dense,
+ struct rev_info *rev)
{
- struct commit *commit = lookup_commit(sha1);
struct commit_list *parent = commit->parents;
struct sha1_array parents = SHA1_ARRAY_INIT;
sha1_array_append(&parents, parent->item->object.sha1);
parent = parent->next;
}
- diff_tree_combined(sha1, &parents, dense, rev);
+ diff_tree_combined(commit->object.sha1, &parents, dense, rev);
sha1_array_clear(&parents);
}
index 96085cbb0f71cdc8e21940130db95ebf5366683f..ae71f4ccf94369b31b1a77373861b02d478d705a 100644 (file)
--- a/diff.h
+++ b/diff.h
struct diff_filespec;
struct userdiff_driver;
struct sha1_array;
+struct commit;
typedef void (*change_fn_t)(struct diff_options *options,
unsigned old_mode, unsigned new_mode,
extern void diff_tree_combined(const unsigned char *sha1, const struct sha1_array *parents, int dense, struct rev_info *rev);
-extern void diff_tree_combined_merge(const unsigned char *sha1, int, struct rev_info *);
+extern void diff_tree_combined_merge(const struct commit *commit, int dense, struct rev_info *rev);
void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const char *b);
diff --git a/log-tree.c b/log-tree.c
index e7694a3a4ca2e6de7fe8f3b5458eb2b65591373a..319bd31e2bd67f5ee38d6b887da2ca1b8e9ac742 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
static int do_diff_combined(struct rev_info *opt, struct commit *commit)
{
- unsigned const char *sha1 = commit->object.sha1;
-
- diff_tree_combined_merge(sha1, opt->dense_combined_merges, opt);
+ diff_tree_combined_merge(commit, opt->dense_combined_merges, opt);
return !opt->loginfo;
}