Merge branch 'jk/no-optional-locks'

Some commands (most notably "git status") makes an opportunistic
update when performing a read-only operation to help optimize later
operations in the same repository.  The new "--no-optional-locks"
option can be passed to Git to disable them.

* jk/no-optional-locks:
  git: add --no-optional-locks option
This commit is contained in:
Junio C Hamano
2017-10-03 15:42:48 +09:00
6 changed files with 41 additions and 1 deletions

View File

@ -444,6 +444,7 @@ static inline enum object_type object_type(unsigned int mode)
#define GIT_NOGLOB_PATHSPECS_ENVIRONMENT "GIT_NOGLOB_PATHSPECS"
#define GIT_ICASE_PATHSPECS_ENVIRONMENT "GIT_ICASE_PATHSPECS"
#define GIT_QUARANTINE_ENVIRONMENT "GIT_QUARANTINE_PATH"
#define GIT_OPTIONAL_LOCKS_ENVIRONMENT "GIT_OPTIONAL_LOCKS"
/*
* This environment variable is expected to contain a boolean indicating
@ -783,6 +784,11 @@ extern int protect_ntfs;
*/
extern int ref_paranoia;
/*
* Returns the boolean value of $GIT_OPTIONAL_LOCKS (or the default value).
*/
int use_optional_locks(void);
/*
* The character that begins a commented line in user-editable file
* that is subject to stripspace.