Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2000 from benesch/preserve-dotgit
Browse files Browse the repository at this point in the history
Fix bug in preservation of vendor/.git
  • Loading branch information
sdboyer authored Sep 5, 2018
2 parents 6b79ccc + 880e871 commit affb4f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions txn_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,8 @@ func (dw *DeltaWriter) Write(path string, sm gps.SourceManager, examples bool, l

// Ensure vendor/.git is preserved if present
if hasDotGit(vpath) {
err = fs.RenameWithFallback(filepath.Join(vpath, ".git"), filepath.Join(vnewpath, "vendor/.git"))
if _, ok := err.(*os.LinkError); ok {
err = fs.RenameWithFallback(filepath.Join(vpath, ".git"), filepath.Join(vnewpath, ".git"))
if err != nil {
return errors.Wrap(err, "failed to preserve vendor/.git")
}
}
Expand Down

0 comments on commit affb4f6

Please sign in to comment.