Reduce scope of scanner

This commit is contained in:
Steve Streeting 2017-02-03 10:02:09 +00:00
parent 3b1ba3e87a
commit 8edfe535b2

@ -1114,9 +1114,8 @@ func IsFileModified(filepath string) (bool, error) {
if err := cmd.Start(); err != nil {
return false, lfserrors.Wrap(err, "Failed to start git status")
}
scanner := bufio.NewScanner(outp)
matched := false
for scanner.Scan() {
for scanner := bufio.NewScanner(outp); scanner.Scan(); {
line := scanner.Text()
// Porcelain format is "<I><W> <filename>"
// Where <I> = index status, <W> = working copy status