summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rwxr-xr-xscript/autobuild.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/script/autobuild.py b/script/autobuild.py
index 6f14845334..246eaf7fe8 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -241,19 +241,14 @@ def cleanup():
def find_git_root():
'''get to the top of the git repo'''
- cwd=os.getcwd()
- while os.getcwd() != '/':
- try:
- os.stat(".git")
- ret = os.getcwd()
- os.chdir(cwd)
- return ret
- except:
- os.chdir("..")
- pass
- os.chdir(cwd)
+ p=os.getcwd()
+ while p != '/':
+ if os.path.isdir(os.path.join(p, ".git")):
+ return p
+ p = os.path.abspath(os.path.join(p, '..'))
return None
+
def rebase_tree(url):
print("Rebasing on %s" % url)
run_cmd("git remote add -t master master %s" % url, show=True, dir=test_master)