git/builtin
Jeff King 25cd291963 config: complain about --local outside of a git repo
The "--local" option instructs git-config to read or modify
the repository-level config. This doesn't make any sense if
you're not actually in a repository.

Older versions of Git would blindly try to read or write
".git/config". For reading, this would result in a quiet
failure, since there was no config to read (and thus no
matching config value). Writing would generally fail
noisily, since ".git" was unlikely to exist. But since
b1ef400ee (setup_git_env: avoid blind fall-back to ".git",
2016-10-20), we catch this in the call to git_pathdup() and
die with an assertion.

Dying is the right thing to do, but we should catch the
problem early and give a more human-friendly error message.

Note that even without --local, git-config will sometimes
default to using local repository config (e.g., when
writing). These cases are already protected by similar
checks, and covered by a test in t1308.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-15 11:30:51 +09:00
..
2017-04-26 15:39:08 +09:00
2016-11-22 13:55:20 -08:00
2017-04-26 15:39:08 +09:00
2017-03-31 08:33:56 -07:00
2017-03-30 14:07:14 -07:00
2017-04-26 15:39:08 +09:00
2017-03-17 13:50:25 -07:00
2017-03-31 08:33:56 -07:00
2017-04-13 17:53:08 -07:00
2017-03-31 08:33:56 -07:00
2017-04-19 21:37:13 -07:00
2017-04-15 00:58:36 -07:00
2017-04-19 21:37:13 -07:00
2016-09-29 15:42:18 -07:00
2017-01-18 15:12:15 -08:00
2017-04-19 21:37:13 -07:00
2017-04-26 15:39:08 +09:00
2017-04-02 09:49:24 -07:00
2017-04-17 21:56:54 -07:00
2015-10-05 13:20:08 -07:00
2017-04-19 21:37:13 -07:00
2017-04-19 21:37:13 -07:00
2017-03-24 13:07:37 -07:00
2017-01-23 18:51:56 -08:00
2017-04-11 00:21:51 -07:00
2017-04-26 15:39:12 +09:00