From 51216dbd2dbb36ca95e8a18b69300028b0314f4f Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Fri, 19 Jul 2013 17:40:16 +0100 Subject: [PATCH] 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 --- .../source-repositories/extra-data.d/98-source-repositories | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elements/source-repositories/extra-data.d/98-source-repositories b/elements/source-repositories/extra-data.d/98-source-repositories index 1a531871..90f534e8 100755 --- a/elements/source-repositories/extra-data.d/98-source-repositories +++ b/elements/source-repositories/extra-data.d/98-source-repositories @@ -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