summaryrefslogtreecommitdiff
path: root/set-libcamera-branch.sh
blob: 01049f2f6f86a90273c043ed78637d69e91d523e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash

# SPDX-License-Identifier: GPL-2.0-or-later

source ./common.sh

REPO=${1}
BRANCH=${2}

ORIGIN=https://git.libcamera.org/libcamera/libcamera.git
LIBCAMERA=${3:-$(srcdir libcamera)}

if [ ! -d $LIBCAMERA ] ;
then
	git clone $ORIGIN $LIBCAMERA
fi

git -C $LIBCAMERA fetch origin --prune
pass_fail $? "Update from origin"

git -C $LIBCAMERA branch -D integration_tests
git -C $LIBCAMERA checkout -b integration_tests

git -C $LIBCAMERA fetch $REPO $BRANCH
pass_fail $? "Fetch $BRANCH from $REPO"

git -C $LIBCAMERA reset --hard FETCH_HEAD
pass_fail $? "Set tree to fetch branch"

git -C $LIBCAMERA rebase origin/master
pass_fail $? "Rebase to master.."

git -C $LIBCAMERA log --oneline HEAD...origin/master

echo "libcamera at version : " $(libcamera_version "$LIBCAMERA")