summaryrefslogtreecommitdiff
path: root/cache-tree.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-11-17 20:05:52 -0800
committerJunio C Hamano <gitster@pobox.com>2016-11-18 15:08:12 -0800
commite38e680a4fe37dbf678a0c943d68e233346beacf (patch)
tree6250499d1889e665c6f60ba50faab195fc2275ad /cache-tree.h
parente3826385d2b05abb4c0f7e3de248ee6b4010ea3b (diff)
downloadgit-jc/cache-tree-wip.tar.gz
cache-tree: freshen the tree object at the top leveljc/cache-tree-wip
"git write-tree" that is asked to write out a tree object out of the index may not actually write the tree object anew, when there already is the same tree object in the object store. The actual writing of the tree object is done as a side effect of updating the cache tree entries fully in the index, and the optimization to skip writing the tree out is done via "has_sha1_file()", i.e. "does the tree already exist in the object store?" After asking "git write-tree" to write a tree out, the caller may not make it reachable from any ref or other anchoring point, which makes the tree object subject to pruning. Call freshen_object() on the top-level tree object to make sure we mark the tree "young" to protect it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache-tree.h')
-rw-r--r--cache-tree.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache-tree.h b/cache-tree.h
index f18789ceff..7e03620349 100644
--- a/cache-tree.h
+++ b/cache-tree.h
@@ -39,6 +39,7 @@ int update_main_cache_tree(int);
#define WRITE_TREE_DRY_RUN 4
#define WRITE_TREE_SILENT 8
#define WRITE_TREE_REPAIR 16
+#define WRITE_TREE_TOPLEVEL 32
/* error return codes */
#define WRITE_TREE_UNREADABLE_INDEX (-1)