mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
autobuild: Simplify find_git_root.
This commit is contained in:
parent
b77bcea352
commit
28a3d2ea30
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user