cmd: better support for bare repositories
authorDavid Aguilar <davvid@gmail.com>
Sun, 15 Jun 2008 23:45:29 +0000 (16:45 -0700)
committerDavid Aguilar <davvid@gmail.com>
Sun, 15 Jun 2008 23:45:29 +0000 (16:45 -0700)
commitfd5f111439e7a2e730b602a155aa533c68badbf8
treea9d2ae2b7b1fcc63fa75dac8d9134f749940e8de
parentabc2e538c6f2fe50f93e6c3fe927236bb41f94f4
cmd: better support for bare repositories

In order to avoid the expense of parsing .git/config
just to know whether or not a repository is bare
at __init__ time, we just pass an optional flag to
Git.__init__():
bare_repo with a default value of False.

Repo.init_bare() was updated to pass this flag.

We could have an optional Git.read_bare_status() function
that does the expensive lookup.  Then, users can optionally
call it at runtime if they really need to know whether or not
a repository is bare.  That seems like a decent tradeoff between
speed, correctness, and common use cases.

Signed-off-by: David Aguilar <davvid@gmail.com>
lib/git/cmd.py
lib/git/repo.py