[jhbuild] [git] pull before switching branch (GNOME bug 591470)
- From: Frederic Peters <fpeters src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [jhbuild] [git] pull before switching branch (GNOME bug 591470)
- Date: Tue, 11 Aug 2009 17:44:55 +0000 (UTC)
commit f7d5f81b6ca02ee55bc6d8a75431e05a84d78c8d
Author: Frédéric Péters <fpeters 0d be>
Date: Tue Aug 11 19:42:28 2009 +0200
[git] pull before switching branch (GNOME bug 591470)
jhbuild/versioncontrol/git.py | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/jhbuild/versioncontrol/git.py b/jhbuild/versioncontrol/git.py
index 1d5d911..ca95f46 100644
--- a/jhbuild/versioncontrol/git.py
+++ b/jhbuild/versioncontrol/git.py
@@ -263,6 +263,18 @@ class GitBranch(Branch):
buildscript.execute(['git', 'stash', 'save', 'jhbuild-stash'],
**git_extra_args)
+ current_branch = self.get_current_branch()
+ if current_branch is None:
+ # things are getting out of hand, check the git repository is
+ # correct
+ try:
+ get_output(['git', 'show'], **git_extra_args)
+ except CommandError:
+ raise CommandError(_('Failed to update module (corrupt .git?)'))
+
+ if current_branch not in ('(no branch)', None):
+ buildscript.execute(['git', 'pull', '--rebase'], **git_extra_args)
+
would_be_branch = self.branch or 'master'
if self.tag:
buildscript.execute(['git', 'checkout', self.tag], **git_extra_args)
@@ -283,18 +295,6 @@ class GitBranch(Branch):
would_be_branch, 'origin/' + would_be_branch],
**git_extra_args)
- current_branch = self.get_current_branch()
- if current_branch is None:
- # things are getting out of hand, check the git repository is
- # correct
- try:
- get_output(['git', 'show'], **git_extra_args)
- except CommandError:
- raise CommandError(_('Failed to update module (corrupt .git?)'))
-
- if current_branch not in ('(no branch)', None):
- buildscript.execute(['git', 'pull', '--rebase'], **git_extra_args)
-
if stashed:
# git stash pop was introduced in 1.5.5,
if check_version(['git', '--version'],
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]