@matheusbsbs / matheus-bagliano / commits / 36ee4ee40e
Fork 0

git-p4: Ensure the working directory and the index are clean before "git-p4 rebase"

Signed-off-by: Simon Hausmann <simon@lst.de>

Simon Hausmann committed Jan 7, 2008 at 14:21 UTC 36ee4ee40e1851442b0b075870cd5de5df6ee2b6
1 file changed +5
contrib/fast-import/git-p4
+5
@@ -1611,6 +1611,11 @@ class P4Rebase(Command):
1611 return self.rebase()
1612
1613 def rebase(self):
1614 + if os.system("git update-index --refresh") != 0:
1615 + 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.");
1616 + if len(read_pipe("git diff-index HEAD --")) > 0:
1617 + die("You have uncommited changes. Please commit them before rebasing or stash them away with git stash.");
1618 +
1619 [upstream, settings] = findUpstreamBranchPoint()
1620 if len(upstream) == 0:
1621 die("Cannot find upstream branchpoint for rebase")