Skip to content

Commit

Permalink
bogus "fatal: Not a git repository"
Browse files Browse the repository at this point in the history
I was just testing that "git ls-remote" change by Junio, and when you're
not in a git repository, it gives this totally bogus warning. The _target_
obviously has to be a git repository, but there's no reason why you'd have
to be in a local git repo when doing an ls-remote.

The reason is commit 73136b2 by Dscho: it
adds calls to git-repo-config in git-parse-remote.sh to get the remote
shorthands etc.

Now, either we should just hide and ignore the error from git-repo-config
(probably bad, because some errors _are_ valid - like git-repo-config
failing due to bad syntax in the config file), or we should just make
git-repo-config quietly handle the case of not being in a git repository.

This does the latter: just quietly accepting (and doing nothing - trying
to set a value will result in the lock-file failing) our lot in life
sounds better than dying with a bogus error message.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Acked-By: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Linus Torvalds authored and Junio C Hamano committed May 26, 2006
1 parent c536032 commit 4d599e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion repo-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ static int get_value(const char* key_, const char* regex_)

int main(int argc, const char **argv)
{
setup_git_directory();
int nongit = 0;
setup_git_directory_gently(&nongit);

while (1 < argc) {
if (!strcmp(argv[1], "--int"))
Expand Down

0 comments on commit 4d599e6

Please sign in to comment.