config: teach "git config --file -" to read from the standard input

The patch extends git config --file interface to allow read config from
stdin.

Editing stdin or setting value in stdin is an error.

Include by absolute path is allowed in stdin config, but not by relative
path.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Kirill A. Shutemov
2014-02-19 00:58:55 +02:00
committed by Junio C Hamano
parent c8985ce053
commit 3caec73b55
5 changed files with 70 additions and 18 deletions

View File

@ -1147,6 +1147,7 @@ extern int update_server_info(int);
#define CONFIG_GENERIC_ERROR 7
struct git_config_source {
unsigned int use_stdin:1;
const char *file;
const char *blob;
};