From 5e45ae158442c619c09afbc442e442949fa17659 Mon Sep 17 00:00:00 2001 From: Jamie Brynes Date: Sun, 5 Jan 2020 19:57:18 +0000 Subject: [PATCH] fix applying patch on Windows machine This bug was caused how the timestamp was formatted for the patch file. On Windows machines, ":" is an invalid character for a filename, but the `stampNano` format for time contains ":". This fix adjusts the time format to be the `stampNano` format with "." subsituted for ":". --- pkg/commands/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 7bcc651cb..08eb78edf 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -628,7 +628,7 @@ func (c *GitCommand) Diff(file *File, plain bool, cached bool) string { func (c *GitCommand) ApplyPatch(patch string, flags ...string) error { c.Log.Warn(patch) - filepath := filepath.Join(c.Config.GetUserConfigDir(), utils.GetCurrentRepoName(), time.Now().Format(time.StampNano)+".patch") + filepath := filepath.Join(c.Config.GetUserConfigDir(), utils.GetCurrentRepoName(), time.Now().Format("Jan _2 15.04.05.000000000")+".patch") if err := c.OSCommand.CreateFileWithContent(filepath, patch); err != nil { return err }