mirror of
https://github.com/YunoHost/apps.git
synced 2024-09-03 20:06:07 +02:00
git is old on saperlipopette
This commit is contained in:
parent
cf3ca03ca7
commit
e691383178
1 changed files with 7 additions and 2 deletions
|
@ -99,9 +99,14 @@ def refresh_cache(app, infos):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
git("remote set-url origin " + infos["url"], in_folder=app_cache_folder(app))
|
git("remote set-url origin " + infos["url"], in_folder=app_cache_folder(app))
|
||||||
current_branch = git("branch --show-current", in_folder=app_cache_folder(app))
|
# With git >= 2.22
|
||||||
|
# current_branch = git("branch --show-current", in_folder=app_cache_folder(app))
|
||||||
|
current_branch = git("rev-parse --abbrev-ref HEAD", in_folder=app_cache_folder(app))
|
||||||
if current_branch != branch:
|
if current_branch != branch:
|
||||||
all_branches = git("branch --format=%(refname:short)", in_folder=app_cache_folder(app)).split()
|
# With git >= 2.13
|
||||||
|
# all_branches = git("branch --format=%(refname:short)", in_folder=app_cache_folder(app)).split()
|
||||||
|
all_branches = git("branch", in_folder=app_cache_folder(app)).split()
|
||||||
|
all_branches.remove('*')
|
||||||
if branch not in all_branches:
|
if branch not in all_branches:
|
||||||
git("remote set-branches --add origin %s" % branch, in_folder=app_cache_folder(app))
|
git("remote set-branches --add origin %s" % branch, in_folder=app_cache_folder(app))
|
||||||
git("fetch origin %s:%s" % (branch, branch), in_folder=app_cache_folder(app))
|
git("fetch origin %s:%s" % (branch, branch), in_folder=app_cache_folder(app))
|
||||||
|
|
Loading…
Add table
Reference in a new issue