Closed ObviouslyGreen closed 5 years ago
I tested this, it seems ok.
stashBranchRegex := regexp.MustCompile(`^(.*?): `)
stashMsgRegex := regexp.MustCompile(`WIP on \(?([^)]*)\)?`)
stashBranchRegexMatch := stashBranchRegex.FindString(trimmed)
branchName := stashBranchRegexMatch[:len(stashBranchRegexMatch)-2]
branchMatches := stashMsgRegex.FindStringSubmatch(branchName)
if len(branchMatches) >= 2 {
branchName = stashBranchRegexMatch[:len(stashBranchRegexMatch)-2]
}
Thanks for the issue btw, and very good of you for submitting the fix 👍 @ObviouslyGreen
fixed it with the pr #44 , please let me know if you have still issues. Thanks for the feedback
For some reason I had a stashed commit for a repo in a detached state i.e.
stash@{0}: WIP on (no branch): test
Quickly threw together a possible fix, but haven't tested with other stuff yet so just opening an issue instead of pr: https://play.golang.org/p/oI9XpuE8-iw