From d23a5117f821b91e1d72745238a4c085a089864e Mon Sep 17 00:00:00 2001 From: Paul Tan Date: Tue, 4 Aug 2015 21:51:40 +0800 Subject: cache-tree: introduce write_index_as_tree() A caller may wish to write a temporary index as a tree. However, write_cache_as_tree() assumes that the index was read from, and will write to, the default index file path. Introduce write_index_as_tree() which removes this limitation by allowing the caller to specify its own index_state and index file path. Signed-off-by: Paul Tan Signed-off-by: Junio C Hamano --- cache-tree.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cache-tree.h') diff --git a/cache-tree.h b/cache-tree.h index aa7b3e4a0a..41c574663a 100644 --- a/cache-tree.h +++ b/cache-tree.h @@ -46,6 +46,7 @@ int update_main_cache_tree(int); #define WRITE_TREE_UNMERGED_INDEX (-2) #define WRITE_TREE_PREFIX_ERROR (-3) +int write_index_as_tree(unsigned char *sha1, struct index_state *index_state, const char *index_path, int flags, const char *prefix); int write_cache_as_tree(unsigned char *sha1, int flags, const char *prefix); void prime_cache_tree(struct index_state *, struct tree *); -- cgit v1.2.3