diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-10-23 17:33:49 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-12-03 10:23:27 +0000 |
commit | 2dc11594d5b95d876c9997ca40dfb08bf06c830b (patch) | |
tree | c2752f38b17e765416dad9ea64688aad0e60d60a /morphlib/plugins/branch_and_merge_plugin.py | |
parent | bb1960c7711a8a48bbaabd188158a3c5d7f0ff04 (diff) | |
download | morph-2dc11594d5b95d876c9997ca40dfb08bf06c830b.tar.gz |
Rework CachedRepo to use the GitDirectory class where possible
This consolidates a bunch of code paths that were previously duplicated.
This also changes the API for local cached repos to match the
function names GitDirectory uses. Note that the remote repo cache still
uses the old names, and should be fixed when time permits.
Some unit tests that use the CachedRepo module required a bit of
inelegant monkey-patching in order that they continue to work. A better
way to do this would be with the 'mock' library (which would need to be
added to Baserock 'build' and 'devel' systems before we could use it).
Diffstat (limited to 'morphlib/plugins/branch_and_merge_plugin.py')
-rw-r--r-- | morphlib/plugins/branch_and_merge_plugin.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index 5531f7f6..76da9736 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -174,7 +174,7 @@ class BranchAndMergePlugin(cliapp.Plugin): cached_repo = lrc.get_updated_repo(root_url) # Check the git branch exists. - cached_repo.resolve_ref(system_branch) + cached_repo.resolve_ref_to_commit(system_branch) with self._initializing_system_branch( ws, root_url, system_branch, cached_repo, base_ref) as (sb, gd): @@ -233,7 +233,7 @@ class BranchAndMergePlugin(cliapp.Plugin): (system_branch, root_url)) # Make sure the base_ref exists. - cached_repo.resolve_ref(base_ref) + cached_repo.resolve_ref_to_commit(base_ref) with self._initializing_system_branch( ws, root_url, system_branch, cached_repo, base_ref) as (sb, gd): |