summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSimon Hausmann <simon@lst.de>2008-01-07 13:21:45 (GMT)
committerSimon Hausmann <simon@lst.de>2008-02-03 18:19:16 (GMT)
commit36ee4ee40e1851442b0b075870cd5de5df6ee2b6 (patch)
tree606a2caee7b52598d160150d999bb3edcf90bfe5 /contrib
parente96e400f67b8478a99f9d2b5d82f08cd21f51a88 (diff)
downloadgit-36ee4ee40e1851442b0b075870cd5de5df6ee2b6.zip
git-36ee4ee40e1851442b0b075870cd5de5df6ee2b6.tar.gz
git-36ee4ee40e1851442b0b075870cd5de5df6ee2b6.tar.bz2
git-p4: Ensure the working directory and the index are clean before "git-p4 rebase"
Signed-off-by: Simon Hausmann <simon@lst.de>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/git-p45
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index a74aabd..e5fe5f6 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1611,6 +1611,11 @@ class P4Rebase(Command):
return self.rebase()
def rebase(self):
+ if os.system("git update-index --refresh") != 0:
+ die("Some files in your working directory are modified and different than what is in your index. You can use git update-index <filename> to bring the index up-to-date or stash away all your changes with git stash.");
+ if len(read_pipe("git diff-index HEAD --")) > 0:
+ die("You have uncommited changes. Please commit them before rebasing or stash them away with git stash.");
+
[upstream, settings] = findUpstreamBranchPoint()
if len(upstream) == 0:
die("Cannot find upstream branchpoint for rebase")