The command added to check whether the directory is git or not was
having syntax error. Fixed the same. Also it seems adding safe-directory
with local doesn't really work which actually makes sense. hence
reverting to using global instead. Its still safer than before as
we are not adding * and are adding the actual path of the directory