diff options
-rw-r--r-- | morphlib/git.py | 10 | ||||
-rw-r--r-- | morphlib/gitdir.py | 3 | ||||
-rw-r--r-- | morphlib/plugins/branch_and_merge_new_plugin.py | 10 |
3 files changed, 22 insertions, 1 deletions
diff --git a/morphlib/git.py b/morphlib/git.py index 27146206..ccd06323 100644 --- a/morphlib/git.py +++ b/morphlib/git.py @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2013 Codethink Limited +# Copyright (C) 2011-2014 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -279,6 +279,10 @@ def copy_repository(runcmd, repo, destdir, is_mirror=True): def checkout_ref(runcmd, gitdir, ref): '''Checks out a specific ref/SHA1 in a git working tree.''' runcmd(['git', 'checkout', ref], cwd=gitdir) + gd = morphlib.gitdir.GitDirectory(gitdir) + if gd.has_fat(): + gd.fat_init() + gd.fat_pull() def index_has_changes(runcmd, gitdir): @@ -308,6 +312,10 @@ def clone_into(runcmd, srcpath, targetpath, ref=None): runcmd(['git', 'checkout', ref], cwd=targetpath) else: runcmd(['git', 'clone', '-b', ref, srcpath, targetpath]) + gd = morphlib.gitdir.GitDirectory(targetpath) + if gd.has_fat(): + gd.fat_init() + gd.fat_pull() def is_valid_sha1(ref): '''Checks whether a string is a valid SHA1.''' diff --git a/morphlib/gitdir.py b/morphlib/gitdir.py index 15c0ee9f..06fcba6f 100644 --- a/morphlib/gitdir.py +++ b/morphlib/gitdir.py @@ -362,6 +362,9 @@ class GitDirectory(object): def checkout(self, branch_name): # pragma: no cover '''Check out a git branch.''' self._runcmd(['git', 'checkout', branch_name]) + if self.has_fat(): + self.fat_init() + self.fat_pull() def branch(self, new_branch_name, base_ref): # pragma: no cover '''Create a git branch based on an existing ref. diff --git a/morphlib/plugins/branch_and_merge_new_plugin.py b/morphlib/plugins/branch_and_merge_new_plugin.py index 8c8a98e9..51cba401 100644 --- a/morphlib/plugins/branch_and_merge_new_plugin.py +++ b/morphlib/plugins/branch_and_merge_new_plugin.py @@ -190,6 +190,10 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin): with self._initializing_system_branch( ws, root_url, system_branch, cached_repo, base_ref) as (sb, gd): + if gd.has_fat(): + gd.fat_init() + gd.fat_pull() + if not self._checkout_has_systems(gd): raise BranchRootHasNoSystemsError(root_url, base_ref) @@ -250,6 +254,9 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin): gd.branch(system_branch, base_ref) gd.checkout(system_branch) + if gd.has_fat(): + gd.fat_init() + gd.fat_pull() if not self._checkout_has_systems(gd): raise BranchRootHasNoSystemsError(root_url, base_ref) @@ -480,6 +487,9 @@ class SimpleBranchAndMergePlugin(cliapp.Plugin): gd.checkout(sb.system_branch_name) gd.update_submodules(self.app) gd.update_remotes() + if gd.has_fat(): + gd.fat_init() + gd.fat_pull() # Change the refs to the chunk. if chunk_ref != sb.system_branch_name: |