Skip to content

Commit 0c0813f

Browse files
authored
Merge pull request #733 from syehoonkim/master
do_git_checkout modified to checkout master or main for opus
2 parents a8e823a + 1dff729 commit 0c0813f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cross_compile_ffmpeg.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,15 @@ do_git_checkout() {
432432
# reset will be useless if they didn't git_get_latest but pretty fast so who cares...plus what if they changed branches? :)
433433
old_git_version=`git rev-parse HEAD`
434434
if [[ -z $desired_branch ]]; then
435-
desired_branch="origin/master"
435+
# Check for either "origin/main" or "origin/master".
436+
if [ $(git show-ref | grep -e origin\/main$ -c) = 1 ]; then
437+
desired_branch="origin/main"
438+
elif [ $(git show-ref | grep -e origin\/master$ -c) = 1 ]; then
439+
desired_branch="origin/master"
440+
else
441+
echo "No valid git branch!"
442+
exit 1
443+
fi
436444
fi
437445
echo "doing git checkout $desired_branch"
438446
git -c 'advice.detachedHead=false' checkout "$desired_branch" || (git_hard_reset && git -c 'advice.detachedHead=false' checkout "$desired_branch") || (git reset --hard "$desired_branch") || exit 1 # can't just use merge -f because might "think" patch files already applied when their changes have been lost, etc...

0 commit comments

Comments
 (0)