diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-11-03 15:52:45 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-11-03 15:52:45 +0100 |
commit | dbc18b92362f60afc05d4ddadd6e73902ae27ec7 (patch) | |
tree | 963e86880e5375a549910e9942e0064a37ddf33d /lib/git/repo.py | |
parent | 6bca9899b5edeed7f964e3124e382c3573183c68 (diff) | |
download | gitpython-dbc18b92362f60afc05d4ddadd6e73902ae27ec7.tar.gz |
repo: added create_* and delete_* methods for refs ( head, tag, remote ) as a convenient shortcut to using the classes manually
Diffstat (limited to 'lib/git/repo.py')
-rw-r--r-- | lib/git/repo.py | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/lib/git/repo.py b/lib/git/repo.py index 52469e04..9c3db055 100644 --- a/lib/git/repo.py +++ b/lib/git/repo.py @@ -213,6 +213,61 @@ class Repo(object): """ return TagReference(self, path) + def create_head(self, path, commit='HEAD', force=False, **kwargs ): + """ + Create a new head within the repository. + + For more documentation, please see the Head.create method. + + Returns + newly created Head Reference + """ + return Head.create(self, path, commit, force, **kwargs) + + def delete_head(self, *heads, **kwargs): + """ + Delete the given heads + + ``kwargs`` + Additional keyword arguments to be passed to git-branch + """ + return Head.delete(self, *heads, **kwargs) + + def create_tag(self, path, ref='HEAD', message=None, force=False, **kwargs): + """ + Create a new tag reference. + + For more documentation, please see the TagReference.create method. + + Returns + TagReference object + """ + return TagReference.create(self, path, ref, message, force, **kwargs) + + def delete_tag(self, *tags): + """ + Delete the given tag references + """ + return TagReference.delete(self, *tags) + + def create_remote(self, name, url, **kwargs): + """ + Create a new remote. + + For more information, please see the documentation of the Remote.create + methods + + Returns + Remote reference + """ + return Remote.create(self, name, url, **kwargs) + + def delete_remote(self, remote): + """ + Delete the given remote. + """ + return Remote.remove(self, remote) + def _get_config_path(self, config_level ): # we do not support an absolute path of the gitconfig on windows , # use the global config instead |