From 10f46e59dea1223558a1dd55b80f5da725c5ac52 Mon Sep 17 00:00:00 2001
From: sam boyer <tech@samboyer.org>
Date: Tue, 24 Oct 2017 09:32:50 -0400
Subject: [PATCH] dep: Use hidden tempdir for old vendor

While there's more work to be done in making all of this safe in the
event of a signal being sent to dep, this change at least means that if
a signal is sent during the rename and a .vendor.orig directory is left
behind, subsequent runs will treat its contents as ignored.

Fixes #1304
---
 txn_writer.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/txn_writer.go b/txn_writer.go
index adb3c473dd..d06de2b439 100644
--- a/txn_writer.go
+++ b/txn_writer.go
@@ -382,7 +382,7 @@ func (sw *SafeWriter) Write(root string, sm gps.SourceManager, examples bool, lo
 			if _, err := os.Stat(vendorbak); err == nil {
 				// If the adjacent dir already exists, bite the bullet and move
 				// to a proper tempdir.
-				vendorbak = filepath.Join(td, "vendor.orig")
+				vendorbak = filepath.Join(td, ".vendor.orig")
 			}
 
 			failerr = fs.RenameWithFallback(vpath, vendorbak)