summaryrefslogtreecommitdiff
path: root/diff.h
diff options
context:
space:
mode:
authorRene Scharfe <rene.scharfe@lsrfire.ath.cx>2006-10-26 18:52:39 +0200
committerJunio C Hamano <junkio@cox.net>2006-10-26 18:31:17 -0700
commit2b60356da5369dd60ab26eabaa91d95b6badf209 (patch)
treecbbdf8cbe6ef081f5e2d48c5d24d7fe283f443c4 /diff.h
parente827633a5d7d627eb1170b2d0c71e944d0d56faf (diff)
downloadgit-2b60356da5369dd60ab26eabaa91d95b6badf209.tar.gz
Make git-cherry handle root trees
This patch on top of 'next' makes built-in git-cherry handle root commits. It moves the static function log-tree.c::diff_root_tree() to tree-diff.c and makes it more similar to diff_tree_sha1() by shuffling around arguments and factoring out the call to log_tree_diff_flush(). Consequently the name is changed to diff_root_tree_sha1(). It is a version of diff_tree_sha1() that compares the empty tree (= root tree) against a single 'real' tree. This function is then used in get_patch_id() to compute patch IDs for initial commits instead of SEGFAULTing, as the current code does if confronted with parentless commits. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diff.h')
-rw-r--r--diff.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/diff.h b/diff.h
index ce3058e437..ac7b21c46b 100644
--- a/diff.h
+++ b/diff.h
@@ -102,6 +102,8 @@ extern int diff_tree(struct tree_desc *t1, struct tree_desc *t2,
const char *base, struct diff_options *opt);
extern int diff_tree_sha1(const unsigned char *old, const unsigned char *new,
const char *base, struct diff_options *opt);
+extern int diff_root_tree_sha1(const unsigned char *new, const char *base,
+ struct diff_options *opt);
struct combine_diff_path {
struct combine_diff_path *next;