From 512c8644c854c6be1f761154d88740c0e90546ca Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 11 Aug 2010 18:10:33 -0700 Subject: Check for dirty repo when switching branches. --- src/pyfedpkg/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pyfedpkg') diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index a811707..8ab50e4 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -578,6 +578,10 @@ def switch_branch(branch, path=os.getcwd()): except git.errors.InvalidGitRepositoryError: raise FedpkgError('%s is not a valid repo' % path) + # See if the repo is dirty first + if repo.is_dirty(): + raise FedpkgError('%s has uncommitted changes.' % path) + # Get our list of branches (locals, remotes) = _list_branches(repo=repo) -- cgit