diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2013-09-17 13:22:09 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2013-09-17 14:34:17 +0000 |
commit | 3f5e504b947f5866e7922bf01347ef2c9ff5e7b6 (patch) | |
tree | c3c8e2f11f1ad8753fad1e5034ba781bffc96d38 /morphlib/gitdir_tests.py | |
parent | 31b0ed683dfe0d99bc82accc05ad329fe527d68f (diff) | |
download | morph-3f5e504b947f5866e7922bf01347ef2c9ff5e7b6.tar.gz |
gitdir: Add method for getting uncommitted changes
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.
Diffstat (limited to 'morphlib/gitdir_tests.py')
-rw-r--r-- | morphlib/gitdir_tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/morphlib/gitdir_tests.py b/morphlib/gitdir_tests.py index 84b8787a..803f1b3e 100644 --- a/morphlib/gitdir_tests.py +++ b/morphlib/gitdir_tests.py @@ -147,3 +147,8 @@ class GitDirectoryContentsTests(unittest.TestCase): gd.checkout('foo') self.assertEqual(gd.HEAD, 'foo') + + def test_uncommitted_changes(self): + gd = morphlib.gitdir.GitDirectory(self.dirname) + self.assertEqual(sorted(gd.get_uncommitted_changes()), + [(' D', 'foo', None)]) |