diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-11-04 13:03:06 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-11-05 13:21:04 +0000 |
commit | 1a86803340081b9e929bb77491dfe01020516164 (patch) | |
tree | 23f76637099c5b444616b1a860d4d87329e226cb /morphlib/gitdir.py | |
parent | 509b1985807a308e31bdff595c939503b6d26a40 (diff) | |
download | morph-1a86803340081b9e929bb77491dfe01020516164.tar.gz |
Improve documentation of GitDirectory class
Clarify that bare repositories are supported, and other fixes.
Diffstat (limited to 'morphlib/gitdir.py')
-rw-r--r-- | morphlib/gitdir.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/morphlib/gitdir.py b/morphlib/gitdir.py index a9837030..94cc5cb9 100644 --- a/morphlib/gitdir.py +++ b/morphlib/gitdir.py @@ -343,12 +343,20 @@ class Remote(object): class GitDirectory(object): - '''Represent a git working tree + .git directory. + '''Represents a local Git repository. - This class represents a directory that is the result of a - "git clone". It includes both the .git subdirectory and - the working tree. It is a thin abstraction, meant to make - it easier to do certain git operations. + This class represents a directory that is the result of a `git clone` or + `git init`. It includes both the .git subdirectory and the working tree. + It is a thin abstraction, meant to make it easier to do certain git + operations. + + In the case of bare repositories, there is no working tree. These are + supported, but a NoWorkingTree exception will be raised if you try to + perform any operations that require a working tree. + + The repository must already exist on disk. Use gitdir.init() to create a + new repo, or gitdir.clone_from_cached_repo() if you want to clone a repo + that Morph has cached locally. ''' |