script/autobuild.py: allow to run from within git rebase -i
authorStefan Metzmacher <metze@samba.org>
Tue, 12 Apr 2022 15:04:53 +0000 (15:04 +0000)
committerStefan Metzmacher <metze@samba.org>
Thu, 28 Apr 2022 15:23:24 +0000 (15:23 +0000)
The 'git clone' used by autobuild.py fails if
GIT_DIR and GIT_WORK_TREE are already defined in the
environment.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Apr 28 15:23:24 UTC 2022 on sn-devel-184

script/autobuild.py

index d309fa0e97c8851f6cafa846d334c5c0f5628629..9f790d8a53e07ffa431a1c7d223659c0ba013a7b 100755 (executable)
@@ -31,6 +31,11 @@ os.environ["PYTHONUNBUFFERED"] = "1"
 # This speeds up testing remarkably.
 os.environ['TDB_NO_FSYNC'] = '1'
 
+# allow autobuild to run within git rebase -i
+if "GIT_DIR" in os.environ:
+    del os.environ["GIT_DIR"]
+if "GIT_WORK_TREE" in os.environ:
+    del os.environ["GIT_WORK_TREE"]
 
 def find_git_root():
     '''get to the top of the git repo'''