aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gbp/git.py5
-rwxr-xr-xgit-buildpackage3
2 files changed, 7 insertions, 1 deletions
diff --git a/gbp/git.py b/gbp/git.py
index e3de82e6..40dc7f74 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -503,7 +503,7 @@ class GitRepository(object):
GitCommand("submodule", [ "add", repo_path ])()
- def update_submodules(self, init=True, recursive=True):
+ def update_submodules(self, init=True, recursive=True, fetch=False):
"""Update all submodules"""
if not self.has_submodules():
return
@@ -512,6 +512,9 @@ class GitRepository(object):
args.append("--recursive")
if init:
args.append("--init")
+ if not fetch:
+ args.append("--no-fetch")
+
GitCommand("submodule", args)()
diff --git a/git-buildpackage b/git-buildpackage
index 181405f1..48e3fc1e 100755
--- a/git-buildpackage
+++ b/git-buildpackage
@@ -106,6 +106,7 @@ def git_archive(repo, cp, output_dir, treeish, comp_type, comp_level):
try:
if repo.has_submodules():
+ repo.update_submodules()
git_archive_submodules(repo, treeish, output, prefix,
comp_type, comp_level, comp_opts)
@@ -140,6 +141,8 @@ def dump_tree(repo, export_dir, treeish):
if ret:
raise GbpError, "Error in dump_tree archive pipe"
+ if repo.has_submodules():
+ repo.update_submodules()
for (subdir, commit) in repo.get_submodules(treeish):
gbp.log.info("Processing submodule %s (%s)" % (subdir, commit[0:8]))
tarpath = [subdir, subdir[2:]][subdir.startswith("./")]