From 9268d1ee8dec6b3483ef8cc25744f321024e0635 Mon Sep 17 00:00:00 2001 From: Frederic Peters Date: Fri, 24 Apr 2009 20:01:38 +0200 Subject: [PATCH] do not call git stash pop on older git versions The git stash pop command was introduced in 1.5.5, for older versions let jhbuild fall back to git stash apply, leaving the change stashed. (GNOME #580148) --- jhbuild/versioncontrol/git.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jhbuild/versioncontrol/git.py b/jhbuild/versioncontrol/git.py index 16a71332..3959714a 100644 --- a/jhbuild/versioncontrol/git.py +++ b/jhbuild/versioncontrol/git.py @@ -30,7 +30,7 @@ import urllib import sys from jhbuild.errors import FatalError, CommandError -from jhbuild.utils.cmds import get_output +from jhbuild.utils.cmds import get_output, check_version from jhbuild.versioncontrol import Repository, Branch, register_repo_type import jhbuild.versioncontrol.svn from jhbuild.commands.sanitycheck import inpath @@ -255,7 +255,12 @@ class GitBranch(Branch): buildscript.execute(['git', 'pull', '--rebase'], cwd=cwd) if stashed: - buildscript.execute(['git', 'stash', 'pop'], cwd=cwd) + # git stash pop was introduced in 1.5.5, + if check_version(['git', '--version'], + r'git version ([\d.]+)', '1.5.5'): + buildscript.execute(['git', 'stash', 'pop'], cwd=cwd) + else: + buildscript.execute(['git', 'stash', 'apply', 'jhbuild-stash'], cwd=cwd) would_be_branch = self.branch or 'master' if self.tag: -- 2.11.4.GIT