From: Junio C Hamano Date: Thu, 10 Mar 2016 19:13:38 +0000 (-0800) Subject: Merge branch 'ps/config-error' into maint X-Git-Tag: v2.7.3~18 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2d5ff66c134681d846e5102a9a62ec99c2178fe1?ds=inline;hp=-c Merge branch 'ps/config-error' into maint Many codepaths forget to check return value from git_config_set(); the function is made to die() to make sure we do not proceed when setting a configuration variable failed. * ps/config-error: config: rename git_config_set_or_die to git_config_set config: rename git_config_set to git_config_set_gently compat: die when unable to set core.precomposeunicode sequencer: die on config error when saving replay opts init-db: die on config errors when initializing empty repo clone: die on config error in cmd_clone remote: die on config error when manipulating remotes remote: die on config error when setting/adding branches remote: die on config error when setting URL submodule--helper: die on config error when cloning module submodule: die on config error when linking modules branch: die on config error when editing branch description branch: die on config error when unsetting upstream branch: report errors in tracking branch setup config: introduce set_or_die wrappers --- 2d5ff66c134681d846e5102a9a62ec99c2178fe1 diff --combined cache.h index 015d53bdff,dd39270f93..e2e64d188e --- a/cache.h +++ b/cache.h @@@ -259,7 -259,6 +259,7 @@@ static inline unsigned create_ce_flags( #define ce_uptodate(ce) ((ce)->ce_flags & CE_UPTODATE) #define ce_skip_worktree(ce) ((ce)->ce_flags & CE_SKIP_WORKTREE) #define ce_mark_uptodate(ce) ((ce)->ce_flags |= CE_UPTODATE) +#define ce_intent_to_add(ce) ((ce)->ce_flags & CE_INTENT_TO_ADD) #define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644) static inline unsigned int create_ce_mode(unsigned int mode) @@@ -1485,7 -1484,7 +1485,7 @@@ extern int update_server_info(int) /* git_config_parse_key() returns these negated: */ #define CONFIG_INVALID_KEY 1 #define CONFIG_NO_SECTION_OR_NAME 2 - /* git_config_set(), git_config_set_multivar() return the above or these: */ + /* git_config_set_gently(), git_config_set_multivar_gently() return the above or these: */ #define CONFIG_NO_LOCK -1 #define CONFIG_INVALID_FILE 3 #define CONFIG_NO_WRITE 4 @@@ -1523,12 -1522,16 +1523,16 @@@ extern int git_config_bool(const char * extern int git_config_maybe_bool(const char *, const char *); extern int git_config_string(const char **, const char *, const char *); extern int git_config_pathname(const char **, const char *, const char *); - extern int git_config_set_in_file(const char *, const char *, const char *); - extern int git_config_set(const char *, const char *); + extern int git_config_set_in_file_gently(const char *, const char *, const char *); + extern void git_config_set_in_file(const char *, const char *, const char *); + extern int git_config_set_gently(const char *, const char *); + extern void git_config_set(const char *, const char *); extern int git_config_parse_key(const char *, char **, int *); extern int git_config_key_is_valid(const char *key); - extern int git_config_set_multivar(const char *, const char *, const char *, int); - extern int git_config_set_multivar_in_file(const char *, const char *, const char *, const char *, int); + extern int git_config_set_multivar_gently(const char *, const char *, const char *, int); + extern void git_config_set_multivar(const char *, const char *, const char *, int); + extern int git_config_set_multivar_in_file_gently(const char *, const char *, const char *, const char *, int); + extern void git_config_set_multivar_in_file(const char *, const char *, const char *, const char *, int); extern int git_config_rename_section(const char *, const char *); extern int git_config_rename_section_in_file(const char *, const char *, const char *); extern const char *git_etc_gitconfig(void);