2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-23 04:29:02 +00:00

Merge pull request #98 from frappe/pdvyas-patch-1

Take care of shallow clones in migrate-to-v5
This commit is contained in:
Anand Doshi 2015-11-18 11:53:40 +05:30
commit 798d485cc1

View File

@ -39,8 +39,9 @@ def validate_v4(bench='.'):
def checkout_v5(repo, bench='.'): def checkout_v5(repo, bench='.'):
cwd = os.path.join(bench, 'apps', repo) 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): 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 checkout v5.0", cwd=cwd)
exec_cmd("git clean -df", cwd=cwd) exec_cmd("git clean -df", cwd=cwd)