diff --git a/install.ps1 b/install.ps1 index 515ebda..d8ef28d 100644 --- a/install.ps1 +++ b/install.ps1 @@ -735,9 +735,20 @@ function Update-Profile() { $local:Path = $LEPTONINFO["${section}"]["Path"] $local:LEPTONGITPATH="${Path}\chrome\.git" - if ( "${Type}" -eq "Git" ){ + if ( "${Type}" -eq "Git" ) { + $local:gitDirty = $false + + if ( "$(git diff --stat)" -ne '' ) { + $local:gitDirty = $true + git --git-dir "${LEPTONGITPATH}" checkout stash + } + git --git-dir "${LEPTONGITPATH}" checkout "${Branch}" git --git-dir "${LEPTONGITPATH}" pull --no-edit + + if ( "${gitDirty}" -eq $true ) { + git --git-dir "${LEPTONGITPATH}" checkout stash pop + } } elseif ( "${Type}" -eq "Local" -or "${Type}" -eq "Release" ) { Check-ChromeExist