Permalink
Browse files

Create .git/info/exclude ourselves if "git init" doesn't, e.g. becaus…

…e GIT_TEMPLATE_DIR set (requested by tarsius)
  • Loading branch information...
1 parent 2f11286 commit 19b2143ab2455b1882dcbe1688c3cbde777d1643 @purcell committed Mar 3, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 darcs-to-git
View
@@ -28,6 +28,7 @@ require 'yaml'
require 'pathname'
require 'iconv'
require 'shellwords'
+require 'fileutils'
# Explicitly setting a time zone would cause darcs to only output in
# that timezone hence we couldn't get the actual patch TZ
@@ -455,7 +456,8 @@ unless File.directory?("_darcs")
run(*darcs_init)
run("git", "init")
- File.open(".git/info/exclude", "a") { |f| f.write("_darcs\n.DS_Store\n") }
+ FileUtils.mkdir_p(".git/info")
+ File.open(".git/info/exclude", "a+") { |f| f.write("_darcs\n.DS_Store\n") }
# Patterns to exclude
git_borings = [] << '(^|/)\.git($|/)' << '(^|/)\.DS_Store$'

0 comments on commit 19b2143

Please sign in to comment.