2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

Take care of shallow clones in migrate-to-v5

This commit is contained in:
Pratik Vyas 2015-01-25 14:59:40 +05:30
parent 5fc81d0a3e
commit 39a6a7dbb1

View File

@ -42,8 +42,9 @@ def validate_v4(bench='.'):
def checkout_v5(repo, bench='.'):
cwd = os.path.join(bench, 'apps', repo)
unshallow = "--unshallow" if os.path.exists(os.path.join(cwd, ".git", "shallow")) else ""
if os.path.exists(cwd):
exec_cmd("git fetch upstream", cwd=cwd)
exec_cmd("git config --add remote.upstream.fetch '+refs/heads/*:refs/remotes/upstream/*'", cwd=cwd)
exec_cmd("git fetch upstream {unshallow}".format(unshallow=unshallow), cwd=cwd)
exec_cmd("git checkout v5.0", cwd=cwd)
exec_cmd("git clean -df", cwd=cwd)