summaryrefslogtreecommitdiff
path: root/gbp/scripts/pq_rpm.py
diff options
context:
space:
mode:
Diffstat (limited to 'gbp/scripts/pq_rpm.py')
-rwxr-xr-xgbp/scripts/pq_rpm.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gbp/scripts/pq_rpm.py b/gbp/scripts/pq_rpm.py
index 5166b5c..98b979f 100755
--- a/gbp/scripts/pq_rpm.py
+++ b/gbp/scripts/pq_rpm.py
@@ -455,6 +455,10 @@ def main(argv):
gbp.log.err("%s is not a git repository" % (os.path.abspath('.')))
return 1
+ if os.path.abspath('.') != repo.path:
+ gbp.log.warn("Switching to topdir before running commands")
+ os.chdir(repo.path)
+
try:
# Create base temporary directory for this run
options.tmp_dir = tempfile.mkdtemp(dir=options.tmp_dir,