aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2018-08-08 09:59:45 +0200
committerGuido Günther <agx@sigxcpu.org>2018-08-08 10:09:46 +0200
commitb8221b8ec388e54064d90bb7409abfe62f57a307 (patch)
tree21404a119d3e4d865e4cbd3f8a3335a5cea28c7f /gbp
parent50b92235c39731f82a0c9de8799b2b0853af6aa3 (diff)
pull: Check that repo is clean before fetching anything
Diffstat (limited to 'gbp')
-rwxr-xr-xgbp/scripts/pull.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/gbp/scripts/pull.py b/gbp/scripts/pull.py
index 968f6093..6f58e837 100755
--- a/gbp/scripts/pull.py
+++ b/gbp/scripts/pull.py
@@ -1,6 +1,6 @@
# vim: set fileencoding=utf-8 :
#
-# (C) 2009,2013,2017 Guido Günther <agx@sigxcpu.org>
+# (C) 2009,2013,2017,2018 Guido Günther <agx@sigxcpu.org>
# 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
# the Free Software Foundation; either version 2 of the License, or
@@ -155,6 +155,15 @@ def main(argv):
else:
raise
+ (ret, out) = repo.is_clean()
+ if not ret:
+ gbp.log.err("You have uncommitted changes in your source tree:")
+ gbp.log.err(out)
+ raise GbpError
+
+ repo.fetch(rem_repo, depth=options.depth)
+ repo.fetch(rem_repo, depth=options.depth, tags=True)
+
for branch in [options.debian_branch, options.upstream_branch]:
if repo.has_branch(branch):
branches.add(branch)
@@ -175,14 +184,6 @@ def main(argv):
if rem == fetch_remote and branch == rem_br:
branches.add(branch)
- (ret, out) = repo.is_clean()
- if not ret:
- gbp.log.err("You have uncommitted changes in your source tree:")
- gbp.log.err(out)
- raise GbpError
-
- repo.fetch(rem_repo, depth=options.depth)
- repo.fetch(rem_repo, depth=options.depth, tags=True)
for branch in branches:
if not fast_forward_branch(rem_repo, branch, repo, options):
retval = 2