diff --git a/mob.go b/mob.go index 9750f4a1..ceaa3604 100644 --- a/mob.go +++ b/mob.go @@ -942,7 +942,7 @@ func openLastModifiedFileIfPresent(configuration config.Configuration) { return } lastModifiedFile := split[1] - if strings.Contains(lastModifiedFile, "\"") { + if strings.HasPrefix(lastModifiedFile, "\"") { lastModifiedFile, _ = strconv.Unquote(lastModifiedFile) } if lastModifiedFile == "" { diff --git a/mob_test.go b/mob_test.go index 30d9c726..f40fbfc8 100644 --- a/mob_test.go +++ b/mob_test.go @@ -1913,8 +1913,12 @@ func gitStatus() GitStatus { if len(line) == 0 { continue } - file := strings.Fields(line) - statusMap[strings.Join(file[1:], " ")] = file[0] + fields := strings.Fields(line) + file := strings.Join(fields[1:], " ") + if strings.HasPrefix(file, "\"") { + file, _ = strconv.Unquote(file) + } + statusMap[file] = fields[0] } return statusMap }