[projects/git-slug: 12/170] Exit with error if cannot fetch repository with list of heads

glen glen at pld-linux.org
Mon Sep 21 21:39:49 CEST 2015


commit 6f84c0de91531582e606003023b079b770261a40
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Mon Sep 12 13:15:12 2011 +0100

    Exit with error if cannot fetch repository with list of heads

 pldrepo/gitrepo.py | 2 +-
 slug.py            | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/pldrepo/gitrepo.py b/pldrepo/gitrepo.py
index 68c5488..e1f0ae0 100644
--- a/pldrepo/gitrepo.py
+++ b/pldrepo/gitrepo.py
@@ -49,7 +49,7 @@ class GitRepo:
         if depth:
             clist.append('--depth={}'.format(depth))
         clist += [ remotename ] + fetchlist
-        return self.commandio(clist)
+        return self.commandexc(clist)
 
     def init(self, remotepull, remotepush = None, remotename=REMOTE_NAME):
         clist = ['git', 'init']
diff --git a/slug.py b/slug.py
index 81b7b0e..57fc032 100755
--- a/slug.py
+++ b/slug.py
@@ -71,7 +71,7 @@ def fetch_packages(options):
     try:
         refs = GitRemoteRefsData(options.remoterefs, options.branch, options.dirpattern)
     except GitRepoError as e:
-        print >> sys.stderr, 'Cannot create repository {}'.format(e)
+        print >> sys.stderr, 'Problem with repository {}: {}'.format(options.remoterefs,e)
         sys.exit()
     except RemoteRefsError as e:
         print >> sys.stderr, 'Problem with file {} in repository {}'.format(*e)
@@ -100,6 +100,9 @@ def fetch_packages(options):
     if options.prune:
         try:
             refs = GitRemoteRefsData(options.remoterefs, '*')
+        except GitRepoError as e:
+            print >> sys.stderr, 'Problem with repository {}: {}'.format(options.remoterefs,e)
+            sys.exit(1)
         except RemoteRefsError as e:
             print >> sys.stderr, 'Problem with file {} in repository {}'.format(*e)
             sys.exit()
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5



More information about the pld-cvs-commit mailing list