Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion builtin/pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -5328,7 +5328,7 @@ int cmd_pack_objects(int argc,
if (!HAVE_THREADS && delta_search_threads != 1)
warning(_("no threads support, ignoring --threads"));
if (!pack_to_stdout && !pack_size_limit)
pack_size_limit = pack_size_limit_cfg;
pack_size_limit = cfg->pack_size_limit_cfg;
if (pack_to_stdout && pack_size_limit)
die(_("--max-pack-size cannot be used to build a pack for transfer"));
if (pack_size_limit && pack_size_limit < 1024*1024) {
Expand Down
3 changes: 2 additions & 1 deletion builtin/update-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ static int add_cacheinfo(unsigned int mode, const struct object_id *oid,
{
int len, option;
struct cache_entry *ce;
struct repo_config_values *cfg = repo_config_values(the_repository);

if (!verify_path(path, mode))
return error("Invalid path '%s'", path);
Expand All @@ -431,7 +432,7 @@ static int add_cacheinfo(unsigned int mode, const struct object_id *oid,
ce->ce_flags = create_ce_flags(stage);
ce->ce_namelen = len;
ce->ce_mode = create_ce_mode(mode);
if (assume_unchanged)
if (cfg->assume_unchanged)
ce->ce_flags |= CE_VALID;
option = allow_add ? ADD_CACHE_OK_TO_ADD : 0;
option |= allow_replace ? ADD_CACHE_OK_TO_REPLACE : 0;
Expand Down
8 changes: 4 additions & 4 deletions environment.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ static int zlib_compression_seen;
int trust_executable_bit = 1;
int has_symlinks = 1;
int minimum_abbrev = 4, default_abbrev = -1;
int assume_unchanged;
char *git_commit_encoding;
char *git_log_output_encoding;
char *apply_default_whitespace;
Expand All @@ -67,7 +66,6 @@ enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
#endif
enum object_creation_mode object_creation_mode = OBJECT_CREATION_MODE;
int grafts_keep_true_parents;
unsigned long pack_size_limit_cfg;

#ifndef PROTECT_HFS_DEFAULT
#define PROTECT_HFS_DEFAULT 0
Expand Down Expand Up @@ -356,7 +354,7 @@ int git_default_core_config(const char *var, const char *value,
}

if (!strcmp(var, "core.ignorestat")) {
assume_unchanged = git_config_bool(var, value);
cfg->assume_unchanged = git_config_bool(var, value);
return 0;
}

Expand Down Expand Up @@ -704,7 +702,7 @@ int git_default_config(const char *var, const char *value,
}

if (!strcmp(var, "pack.packsizelimit")) {
pack_size_limit_cfg = git_config_ulong(var, value, ctx->kvi);
cfg->pack_size_limit_cfg = git_config_ulong(var, value, ctx->kvi);
return 0;
}

Expand Down Expand Up @@ -738,8 +736,10 @@ void repo_config_values_init(struct repo_config_values *cfg)
cfg->check_stat = 1;
cfg->zlib_compression_level = Z_BEST_SPEED;
cfg->pack_compression_level = Z_DEFAULT_COMPRESSION;
cfg->assume_unchanged = 0;
cfg->precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */
cfg->core_sparse_checkout_cone = 0;
cfg->sparse_expect_files_outside_of_patterns = 0;
cfg->warn_on_object_refname_ambiguity = 1;
cfg->pack_size_limit_cfg = 0;
}
5 changes: 3 additions & 2 deletions environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,15 @@ struct repo_config_values {
int check_stat;
int zlib_compression_level;
int pack_compression_level;
int assume_unchanged;
int precomposed_unicode;
int core_sparse_checkout_cone;
int warn_on_object_refname_ambiguity;
int protect_hfs;
int protect_ntfs;
int ignore_case;
unsigned long pack_size_limit_cfg;


/* section "sparse" config values */
int sparse_expect_files_outside_of_patterns;
Expand Down Expand Up @@ -181,10 +184,8 @@ int have_git_dir(void);
extern int trust_executable_bit;
extern int has_symlinks;
extern int minimum_abbrev, default_abbrev;
extern int assume_unchanged;
extern char *apply_default_whitespace;
extern char *apply_default_ignorewhitespace;
extern unsigned long pack_size_limit_cfg;

enum rebase_setup_type {
AUTOREBASE_NEVER = 0,
Expand Down
5 changes: 3 additions & 2 deletions object-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,7 @@ static int odb_transaction_files_write_object_stream(struct odb_transaction *bas
size_t size,
struct object_id *result_oid)
{
struct repo_config_values *cfg = repo_config_values(the_repository);
struct odb_transaction_files *transaction = container_of(base,
struct odb_transaction_files,
base);
Expand All @@ -1298,8 +1299,8 @@ static int odb_transaction_files_write_object_stream(struct odb_transaction *bas
* the difference between the inflated and on-disk size is limited
* to zlib compression and is sufficient for this check.
*/
if (state->nr_written && pack_size_limit_cfg &&
pack_size_limit_cfg < state->offset + size)
if (state->nr_written && cfg->pack_size_limit_cfg &&
cfg->pack_size_limit_cfg < state->offset + size)
flush_packfile_transaction(transaction);

CALLOC_ARRAY(idx, 1);
Expand Down
9 changes: 6 additions & 3 deletions read-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,11 @@ void rename_index_entry_at(struct index_state *istate, int nr, const char *new_n
*/
void fill_stat_cache_info(struct index_state *istate, struct cache_entry *ce, struct stat *st)
{
struct repo_config_values *cfg = repo_config_values(the_repository);

fill_stat_data(&ce->ce_stat_data, st);

if (assume_unchanged)
if (cfg->assume_unchanged)
ce->ce_flags |= CE_VALID;

if (S_ISREG(st->st_mode)) {
Expand Down Expand Up @@ -1346,6 +1348,7 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,
{
struct stat st;
struct cache_entry *updated;
struct repo_config_values *cfg = repo_config_values(the_repository);
int changed;
int refresh = options & CE_MATCH_REFRESH;
int ignore_valid = options & CE_MATCH_IGNORE_VALID;
Expand Down Expand Up @@ -1405,7 +1408,7 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,
* is not marked VALID, this is the place to mark it
* valid again, under "assume unchanged" mode.
*/
if (ignore_valid && assume_unchanged &&
if (ignore_valid && cfg->assume_unchanged &&
!(ce->ce_flags & CE_VALID))
; /* mark this one VALID again */
else {
Expand Down Expand Up @@ -1440,7 +1443,7 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,
* (i.e. things to be edited) will reacquire CE_VALID bit
* automatically, which is not really what we want.
*/
if (!ignore_valid && assume_unchanged &&
if (!ignore_valid && cfg->assume_unchanged &&
!(ce->ce_flags & CE_VALID))
updated->ce_flags &= ~CE_VALID;

Expand Down
Loading