diff options
author | Jesse Keating <jkeating@redhat.com> | 2010-08-11 18:10:33 -0700 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2010-08-11 22:09:06 -0700 |
commit | 512c8644c854c6be1f761154d88740c0e90546ca (patch) | |
tree | cef27fdce182eb1d4d75bc25ee6639ea131f6a53 /src | |
parent | 411e3abeddb3a3d232b07baf9dfa499269f7002e (diff) | |
download | fedora-packager-512c8644c854c6be1f761154d88740c0e90546ca.tar.gz fedora-packager-512c8644c854c6be1f761154d88740c0e90546ca.tar.xz fedora-packager-512c8644c854c6be1f761154d88740c0e90546ca.zip |
Check for dirty repo when switching branches.
Diffstat (limited to 'src')
-rw-r--r-- | src/pyfedpkg/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
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) |