lib/repo-fixture/fixture.rb in repo-fixture-1.0.1 vs lib/repo-fixture/fixture.rb in repo-fixture-1.0.2
- old
+ new
@@ -9,11 +9,17 @@
attr_reader :repo
def initialize(repo)
@repo = repo
- repo.git('config --global user.email "fake@example.com"')
- repo.git('config --global user.name "Fake Person"')
+
+ if repo.git('config --global user.email').strip.empty?
+ repo.git('config --global user.email "fake@example.com"')
+ end
+
+ if repo.git('config --global user.name').strip.empty?
+ repo.git('config --global user.name "Fake Person"')
+ end
end
# Copies files into the repo.
# Optional block receives each file, return value is the desired path inside the archive.
def copy_files(files)