eliminated unnecessary cd and failing substitution

Changing the working directory in a sub-subshell
does not change the working directory of the executing
shell.

The substitution was broken for me on _all_ my machines,
so I started looking into the business.
Adding a fix for the DISABLE_UNTRACKED_FILES_DIRTY option.
Merge pull request #1775 from marcusmueller/fixupgradetool

fix for failing substition & eliminated unnecessary cd
Merge pull request #1834 from croach/disable_untracked_files_dirty_fix

Adding a fix for the DISABLE_UNTRACKED_FILES_DIRTY option.
Merge remote-tracking branch 'origin/master' into local