update branch if mod is not yet checked out

This commit is contained in:
bebbo
2023-04-27 10:39:34 +02:00
parent 50721c1bcd
commit b35d8bb5c9
+7 -5
View File
@@ -1073,11 +1073,13 @@ branch:
mv .repos .repos.bak; \
grep -v $(mod) .repos.bak > .repos; \
echo "$(mod) $$url $(branch)" >> .repos; \
pushd projects/$(mod); \
git fetch origin $(branch):$(branch); \
git checkout $(branch); \
git branch --set-upstream-to=origin/$(branch) $(branch); \
popd ; \
if [ -d projects/$(mod) ]; then \
pushd projects/$(mod); \
git fetch origin $(branch):$(branch); \
git checkout $(branch); \
git branch --set-upstream-to=origin/$(branch) $(branch); \
popd ; \
fi \
else \
echo "$(mod) $(branch) does NOT exist!"; \
fi