summaryrefslogtreecommitdiff
path: root/t/t5510-fetch.sh
diff options
context:
space:
mode:
authorLibravatar Derrick Stolee <dstolee@microsoft.com>2019-09-02 19:22:02 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-09-03 12:06:14 -0700
commit50f26bd035816c2bb79582b834d59b49292502a9 (patch)
tree48d8a75a581c0acb513b5351f472d0a6aa97fe93 /t/t5510-fetch.sh
parentrepo-settings: create feature.experimental setting (diff)
downloadtgif-50f26bd035816c2bb79582b834d59b49292502a9.tar.xz
fetch: add fetch.writeCommitGraph config setting
The commit-graph feature is now on by default, and is being written during 'git gc' by default. Typically, Git only writes a commit-graph when a 'git gc --auto' command passes the gc.auto setting to actualy do work. This means that a commit-graph will typically fall behind the commits that are being used every day. To stay updated with the latest commits, add a step to 'git fetch' to write a commit-graph after fetching new objects. The fetch.writeCommitGraph config setting enables writing a split commit-graph, so on average the cost of writing this file is very small. Occasionally, the commit-graph chain will collapse to a single level, and this could be slow for very large repos. For additional use, adjust the default to be true when feature.experimental is enabled. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5510-fetch.sh')
-rwxr-xr-xt/t5510-fetch.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 139f7106f7..91ede622f0 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -570,6 +570,19 @@ test_expect_success 'LHS of refspec follows ref disambiguation rules' '
)
'
+test_expect_success 'fetch.writeCommitGraph' '
+ git clone three write &&
+ (
+ cd three &&
+ test_commit new
+ ) &&
+ (
+ cd write &&
+ git -c fetch.writeCommitGraph fetch origin &&
+ test_path_is_file .git/objects/info/commit-graphs/commit-graph-chain
+ )
+'
+
# configured prune tests
set_config_tristate () {