summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-08-11 18:10:33 -0700
committerJesse Keating <jkeating@redhat.com>2010-08-11 22:09:06 -0700
commit512c8644c854c6be1f761154d88740c0e90546ca (patch)
treecef27fdce182eb1d4d75bc25ee6639ea131f6a53
parent411e3abeddb3a3d232b07baf9dfa499269f7002e (diff)
downloadfedora-packager-512c8644c854c6be1f761154d88740c0e90546ca.tar.gz
fedora-packager-512c8644c854c6be1f761154d88740c0e90546ca.tar.xz
fedora-packager-512c8644c854c6be1f761154d88740c0e90546ca.zip
Check for dirty repo when switching branches.
-rw-r--r--src/pyfedpkg/__init__.py4
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)