mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 13:46:32 +00:00
download/git: run all git commands in the current directory
That way, we can pushd earlier, which will help with last-ditch recovery in a followup commit. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Arnout Vandecappelle <arnout@mind.be> Reviewed-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Tested-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
f1eb192e26
commit
577315687f
@ -34,8 +34,10 @@ done
|
|||||||
|
|
||||||
shift $((OPTIND-1)) # Get rid of our options
|
shift $((OPTIND-1)) # Get rid of our options
|
||||||
|
|
||||||
# We want to check if a cache of the git clone of this repo already exists.
|
# Create and cd into the directory that will contain the local git cache
|
||||||
git_cache="${dl_dir}/git"
|
git_cache="${dl_dir}/git"
|
||||||
|
mkdir -p "${git_cache}"
|
||||||
|
pushd "${git_cache}" >/dev/null
|
||||||
|
|
||||||
# Caller needs to single-quote its arguments to prevent them from
|
# Caller needs to single-quote its arguments to prevent them from
|
||||||
# being expanded a second time (in case there are spaces in them)
|
# being expanded a second time (in case there are spaces in them)
|
||||||
@ -70,9 +72,7 @@ _EOF_
|
|||||||
# We can still go through the wrapper, because 'init' does not use the
|
# We can still go through the wrapper, because 'init' does not use the
|
||||||
# path pointed to by GIT_DIR, but really uses the directory passed as
|
# path pointed to by GIT_DIR, but really uses the directory passed as
|
||||||
# argument.
|
# argument.
|
||||||
_git init "'${git_cache}'"
|
_git init .
|
||||||
|
|
||||||
pushd "${git_cache}" >/dev/null
|
|
||||||
|
|
||||||
# Ensure the repo has an origin (in case a previous run was killed).
|
# Ensure the repo has an origin (in case a previous run was killed).
|
||||||
if ! _git remote |grep -q -E '^origin$'; then
|
if ! _git remote |grep -q -E '^origin$'; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user