aboutsummaryrefslogtreecommitdiff
path: root/tree-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-11-03 00:23:52 -0800
committerJunio C Hamano <junkio@cox.net>2006-11-03 00:23:52 -0800
commit407e1d6e127357a0fbe1a9f91ee616a2b7ec29db (patch)
treea2efb8d179aff14b73db024f936ef0dd092b7a7c /tree-diff.c
parentaac91b7eeae4e8cf6521a5370caf03eb432ce492 (diff)
parent6255ef08ae746bdad34851297a989ad6f36f6a21 (diff)
downloadgit-407e1d6e127357a0fbe1a9f91ee616a2b7ec29db.tar.gz
git-407e1d6e127357a0fbe1a9f91ee616a2b7ec29db.tar.xz
Merge branch 'master' into np/index-pack
* master: (90 commits) gitweb: Better support for non-CSS aware web browsers gitweb: Output also empty patches in "commitdiff" view gitweb: Use git-for-each-ref to generate list of heads and/or tags for-each-ref: "creator" and "creatordate" fields Add --global option to git-repo-config. pack-refs: Store the full name of the ref even when packing only tags. git-clone documentation didn't mention --origin as equivalent of -o Minor grammar fixes for git-diff-index.txt link_temp_to_file: call adjust_shared_perm() only when we created the directory Remove uneccessarily similar printf() from print_ref_list() in builtin-branch pack-objects doesn't create random pack names branch: work in subdirectories. gitweb: Use 's' regexp modifier to secure against filenames with LF gitweb: Secure against commit-ish/tree-ish with the same name as path gitweb: esc_html() author in blame git-svnimport: support for partial imports link_temp_to_file: don't leave the path truncated on adjust_shared_perm failure Move deny_non_fast_forwards handling completely into receive-pack. revision traversal: --unpacked does not limit commit list anymore. Continue traversal when rev-list --unpacked finds a packed commit. ...
Diffstat (limited to 'tree-diff.c')
-rw-r--r--tree-diff.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tree-diff.c b/tree-diff.c
index 7e2f4f088..37d235e06 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -215,6 +215,24 @@ int diff_tree_sha1(const unsigned char *old, const unsigned char *new, const cha
return retval;
}
+int diff_root_tree_sha1(const unsigned char *new, const char *base, struct diff_options *opt)
+{
+ int retval;
+ void *tree;
+ struct tree_desc empty, real;
+
+ tree = read_object_with_reference(new, tree_type, &real.size, NULL);
+ if (!tree)
+ die("unable to read root tree (%s)", sha1_to_hex(new));
+ real.buf = tree;
+
+ empty.size = 0;
+ empty.buf = "";
+ retval = diff_tree(&empty, &real, base, opt);
+ free(tree);
+ return retval;
+}
+
static int count_paths(const char **paths)
{
int i = 0;