File tree Expand file tree Collapse file tree 5 files changed +25
-3
lines changed Expand file tree Collapse file tree 5 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,6 @@ impl Cache {
162162 . copied ( )
163163 }
164164
165- #[ cfg( feature = "blob-diff" ) ]
166165 pub ( crate ) fn big_file_threshold ( & self ) -> Result < u64 , config:: unsigned_integer:: Error > {
167166 Ok ( self
168167 . resolved
Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ impl crate::Repository {
4242 & self . options
4343 }
4444
45+ /// Return the big-file threshold above which Git will not perform a diff anymore or try to delta-diff packs,
46+ /// as configured by `core.bigFileThreshold`, or the default value.
47+ pub fn big_file_threshold ( & self ) -> Result < u64 , config:: unsigned_integer:: Error > {
48+ self . config . big_file_threshold ( )
49+ }
50+
4551 /// Obtain options for use when connecting via `ssh`.
4652 #[ cfg( feature = "blocking-network-client" ) ]
4753 pub fn ssh_connect_options (
Original file line number Diff line number Diff line change 192192 echo $' [remote "any"]\n\t url=anyurl' >> config
193193
194194)
195+
196+ git init big-file-threshold
197+ (cd big-file-threshold
198+ git config core.bigFileThreshold 42
199+ )
Original file line number Diff line number Diff line change @@ -2,6 +2,20 @@ mod config_snapshot;
22mod identity;
33mod remote;
44
5+ #[ test]
6+ fn big_file_threshold ( ) -> crate :: Result {
7+ let repo = repo ( "with-hasconfig" ) ;
8+ assert_eq ! (
9+ repo. big_file_threshold( ) ?,
10+ 512 * 1024 * 1024 ,
11+ "Git really handles huge files, and this is the default"
12+ ) ;
13+
14+ let repo = crate :: repository:: config:: repo ( "big-file-threshold" ) ;
15+ assert_eq ! ( repo. big_file_threshold( ) ?, 42 , "It picks up configured values as well" ) ;
16+ Ok ( ( ) )
17+ }
18+
519#[ cfg( feature = "blocking-network-client" ) ]
620mod ssh_options {
721 use std:: ffi:: OsStr ;
@@ -38,12 +52,10 @@ mod ssh_options {
3852#[ cfg( any( feature = "blocking-network-client" , feature = "async-network-client" ) ) ]
3953mod transport_options;
4054
41- #[ cfg( feature = "blocking-network-client" ) ]
4255pub fn repo ( name : & str ) -> gix:: Repository {
4356 repo_opts ( name, |opts| opts. strict_config ( true ) )
4457}
4558
46- #[ cfg( feature = "blocking-network-client" ) ]
4759pub fn repo_opts ( name : & str , modify : impl FnOnce ( gix:: open:: Options ) -> gix:: open:: Options ) -> gix:: Repository {
4860 let dir = gix_testtools:: scripted_fixture_read_only ( "make_config_repos.sh" ) . unwrap ( ) ;
4961 gix:: open_opts ( dir. join ( name) , modify ( gix:: open:: Options :: isolated ( ) ) ) . unwrap ( )
You can’t perform that action at this time.
0 commit comments