tidy extraction of remote repo sha; use empty() and appendTo() to ensure index status labels are inserted if its not been run previously