File tree 5 files changed +25
-3
lines changed
5 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,6 @@ impl Cache {
162
162
. copied ( )
163
163
}
164
164
165
- #[ cfg( feature = "blob-diff" ) ]
166
165
pub ( crate ) fn big_file_threshold ( & self ) -> Result < u64 , config:: unsigned_integer:: Error > {
167
166
Ok ( self
168
167
. resolved
Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ impl crate::Repository {
42
42
& self . options
43
43
}
44
44
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
+
45
51
/// Obtain options for use when connecting via `ssh`.
46
52
#[ cfg( feature = "blocking-network-client" ) ]
47
53
pub fn ssh_connect_options (
Original file line number Diff line number Diff line change 192
192
echo $' [remote "any"]\n\t url=anyurl' >> config
193
193
194
194
)
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;
2
2
mod identity;
3
3
mod remote;
4
4
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
+
5
19
#[ cfg( feature = "blocking-network-client" ) ]
6
20
mod ssh_options {
7
21
use std:: ffi:: OsStr ;
@@ -38,12 +52,10 @@ mod ssh_options {
38
52
#[ cfg( any( feature = "blocking-network-client" , feature = "async-network-client" ) ) ]
39
53
mod transport_options;
40
54
41
- #[ cfg( feature = "blocking-network-client" ) ]
42
55
pub fn repo ( name : & str ) -> gix:: Repository {
43
56
repo_opts ( name, |opts| opts. strict_config ( true ) )
44
57
}
45
58
46
- #[ cfg( feature = "blocking-network-client" ) ]
47
59
pub fn repo_opts ( name : & str , modify : impl FnOnce ( gix:: open:: Options ) -> gix:: open:: Options ) -> gix:: Repository {
48
60
let dir = gix_testtools:: scripted_fixture_read_only ( "make_config_repos.sh" ) . unwrap ( ) ;
49
61
gix:: open_opts ( dir. join ( name) , modify ( gix:: open:: Options :: isolated ( ) ) ) . unwrap ( )
You can’t perform that action at this time.
0 commit comments