summaryrefslogtreecommitdiff
path: root/morphlib/gitdir.py
Commit message (Collapse)AuthorAgeFilesLines
...
* GitDir: Add resolve_ref_to_{commit,tree} methodsRichard Maw2013-11-221-5/+10
| | | | | | | | | | | | Some APIs should take SHA1 object IDs, there needs to be a way to get one from a ref. To handle this, we add APIs for getting either the commit or the tree pointed to by the ref. Commits are provided because we need to create commits from existing commits and update refs from existing values. Trees are provided because we need trees to create commits, and we can read trees into the index to eventually create another tree.
* GitDir: Provide more specific object access than cat-fileRichard Maw2013-11-221-3/+27
| | | | | | | We need to use cat-file for files by SHA1, commits by SHA1 and files by ref and path, so provide access in separate methods, since while it's all the same thing "under the hood", it avoids the user needing to know the command-line syntax.
* GitDir: Allow config values ending in whitespaceRichard Maw2013-11-221-2/+2
|
* GitDir: remove duplicate definition of update_remotesRichard Maw2013-11-221-4/+0
|
* gitdir: Add method for getting uncommitted changesRichard Maw2013-09-171-0/+32
| | | | | | | | | | get_uncommitted_changes() is needed for morph status to tell if git repositories have changes in them. _get_status() is private, since it does not currently have a user, the small amount of code in get_uncommitted_changes() wrapping _get_status() is in the GitDirectory class instead of the branch and merge plugin, since `morph build` will also need to know about uncommitted changes.
* gitdir: add HEAD property to find the current branchRichard Maw2013-09-171-0/+5
| | | | | This is needed for status to tell if a repo is checked out in an unexpected branch.
* gitdir: Add methods to inspect contentsRichard Maw2013-09-051-0/+69
| | | | | | This adds methods to list and read files. The difference between doing this to a commit and the currrent working tree is abstracted over by whether the passed ref is None or omitted.
* Add GitDir.is_currently_checked_outLars Wirzenius2013-08-151-0/+17
| | | | | | | | | | | | | | | This is needed when we load morphologies in "morph edit": it needs to load things differently depending on whether we're loading from the currently checked out ref or not. The new method does not have a unit test, because I'm betting that the test would not find a real bug. The test would just set up a git repo and check whether the right ref is checked out in a couple of ways (it is, and it isn't), and the code is simple enough that it's unlikely to break the test. Creating the test, however, is a fair bit of work. What the test would not catch is when we need the method to do something quite different, but then we'll want a new method anyway.
* Add GitDirectory classLars Wirzenius2013-08-061-0/+131