From faa623eb93f8e6f2334f4405f5a69c67484804e9 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Fri, 20 Mar 2015 15:55:57 +0200 Subject: [PATCH] A few minor tweaks. --- manual tests/3 git wrap/meson.build | 2 ++ wrap.py | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/manual tests/3 git wrap/meson.build b/manual tests/3 git wrap/meson.build index f3cce0014..7fd5083ee 100644 --- a/manual tests/3 git wrap/meson.build +++ b/manual tests/3 git wrap/meson.build @@ -6,3 +6,5 @@ exe = executable('gitprog', 'prog.c', include_directories : sp.get_variable('subproj_inc'), link_with : sp.get_variable('subproj_lib'), ) + +test('maintest', exe) diff --git a/wrap.py b/wrap.py index 9c8840306..3b3b64045 100644 --- a/wrap.py +++ b/wrap.py @@ -69,9 +69,10 @@ class Resolver: if revno.lower() == 'head': subprocess.check_call(['git', 'pull'], cwd=checkoutdir) else: - subprocess.check_call(['git', 'fetch'], cwd=checkoutdir) - subprocess.check_call(['git', 'checkout', revno], - cwd=checkoutdir) + if subprocess.call(['git', 'checkout', revno], cwd=checkoutdir) != 0: + subprocess.check_call(['git', 'fetch'], cwd=checkoutdir) + subprocess.check_call(['git', 'checkout', revno], + cwd=checkoutdir) else: subprocess.check_call(['git', 'clone', p.get('url'), p.get('directory')], cwd=self.subdir_root)