aboutsummaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorRene Scharfe <rene.scharfe@lsrfire.ath.cx>2006-10-14 12:45:36 +0200
committerJunio C Hamano <junkio@cox.net>2006-10-14 11:49:52 -0700
commitabdc3fc84216a9334f40f3b7ce13e20a825697d0 (patch)
tree05a066dcb1ff662962794be159f23ca05714aa2a /merge-recursive.c
parentce91fc6eb9c4aefc73f845fc7104f332b2b308d2 (diff)
downloadgit-abdc3fc84216a9334f40f3b7ce13e20a825697d0.tar.gz
git-abdc3fc84216a9334f40f3b7ce13e20a825697d0.tar.xz
Add hash_sha1_file()
Most callers of write_sha1_file_prepare() are only interested in the resulting hash but don't care about the returned file name or the header. This patch adds a simple wrapper named hash_sha1_file() which does just that, and converts potential callers. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 611cd95cf..2ba43ae84 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1235,13 +1235,10 @@ int merge(struct commit *h1,
if (merged_common_ancestors == NULL) {
/* if there is no common ancestor, make an empty tree */
struct tree *tree = xcalloc(1, sizeof(struct tree));
- unsigned char hdr[40];
- int hdrlen;
tree->object.parsed = 1;
tree->object.type = OBJ_TREE;
- write_sha1_file_prepare(NULL, 0, tree_type, tree->object.sha1,
- hdr, &hdrlen);
+ hash_sha1_file(NULL, 0, tree_type, tree->object.sha1);
merged_common_ancestors = make_virtual_commit(tree, "ancestor");
}