[Frugalware-git] pacman-tools: dg: pull now works even if there are
uncommitted changes
Miklos Vajna
vmiklos at frugalware.org
Sat Nov 3 15:33:13 CET 2007
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-tools.git;a=commitdiff;h=95f2c336f593541fd8a98ac5c69d3167217fcceb
commit 95f2c336f593541fd8a98ac5c69d3167217fcceb
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Sat Nov 3 15:33:09 2007 +0100
dg: pull now works even if there are uncommitted changes
diff --git a/darcs-git.py b/darcs-git.py
index ed6428c..54a925f 100755
--- a/darcs-git.py
+++ b/darcs-git.py
@@ -632,8 +632,16 @@ Options:
if ret in ("n", "q"):
sys.exit(0)
print "Invalid response, try again!"
+ if os.system("git diff-index --quiet --cached HEAD && git diff-files --quiet") != 0:
+ changes = True
+ if os.system("git stash") != 0:
+ sys.exit(1)
+ else:
+ changes = False
if os.system("git rebase %s" % options.gitopts) != 0:
sys.exit(1)
+ if changes and os.system("git stash apply --index && sed -i '$d' `git rev-parse --show-cdup`.git/logs/refs/stash") != 0:
+ sys.exit(1)
def get(argv):
def usage(ret):
More information about the Frugalware-git
mailing list