1
0
Fork 0
mirror of https://github.com/ArtemSBulgakov/buildozer-action.git synced 2024-08-16 10:09:52 +02:00

Fix pulling when unrelated histories

This commit is contained in:
Artem Bulgakov 2020-12-24 22:39:08 +03:00
parent 5939413afb
commit 58679ab44f

View file

@ -65,7 +65,16 @@ os.makedirs(directory, exist_ok=True)
subprocess.check_call(["git", "config", "user.name", author_name])
subprocess.check_call(["git", "config", "user.email", author_email])
# Ensure that there are no changes
subprocess.check_call(["git", "pull", "origin", data_repository, "--ff-only"])
subprocess.check_call(
[
"git",
"pull",
"origin",
data_repository,
"--ff-only",
"--allow-unrelated-histories",
]
)
# Try to push several times
for i in range(3):
@ -86,7 +95,15 @@ for i in range(3):
)
# Pull new changes
subprocess.check_call(
["git", "pull", "origin", data_repository, "--force", "--ff-only"]
[
"git",
"pull",
"origin",
data_repository,
"--force",
"--ff-only",
"--allow-unrelated-histories",
]
)
else:
break # Exit loop if there is no errors