Set work-dir to cached repository

source-repositories does a git reset on the .git directory of cached
repositories. But doesn't specify the directory to reset. A working
directory needs to be specified so that the $PWD isn't used.

Without this change $PWD is polluted with the contents of repositories
being cached.

Change-Id: Ic37b702ac579bf766bb2204a988fa9468d308abf
This commit is contained in:
Derek Higgins 2013-07-19 17:40:16 +01:00
parent 7e408271a7
commit 51216dbd2d

View File

@ -55,7 +55,7 @@ function get_repos_for_element(){
mv ${CACHE_PATH}{.tmp,}
elif [ -z "$DIB_OFFLINE" ] ; then
git --git-dir=$CACHE_PATH/.git fetch
git --git-dir=$CACHE_PATH/.git reset --hard origin/master
git --git-dir=$CACHE_PATH/.git --work-tree=$CACHE_PATH reset --hard origin/master
fi
sudo git clone $CACHE_PATH $REPO_DIRECTORY
else