Skip to content

Commit

Permalink
git-p4: Ensure the working directory and the index are clean before "…
Browse files Browse the repository at this point in the history
…git-p4 rebase"

Signed-off-by: Simon Hausmann <simon@lst.de>
  • Loading branch information
Simon Hausmann committed Feb 3, 2008
1 parent e96e400 commit 36ee4ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contrib/fast-import/git-p4
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 36ee4ee

Please sign in to comment.