@@ -274,12 +274,8 @@ function initialize_project(path, name = default_name_from_path(path);
274
274
275
275
if git
276
276
repo = LibGit2. init (path)
277
- gc = LibGit2. GitConfig (repo)
278
- LibGit2. get (gc, " user.name" , LibGit2. getconfig (" user.name" , false )) ||
279
- LibGit2. set! (gc, " user.name" , " DrWatson" )
280
- LibGit2. get (gc, " user.email" , LibGit2. getconfig (" user.email" , false )) ||
281
- LibGit2. set! (gc, " user.email" , " no@mail" )
282
- LibGit2. commit (repo, " Initial commit" )
277
+ sig = LibGit2. Signature (" DrWatson" , " no@mail" , round (Int, time ()), 0 )
278
+ LibGit2. commit (repo, " Initial commit" ; author= sig, committer= sig)
283
279
end
284
280
285
281
Pkg. activate (path)
@@ -293,11 +289,14 @@ function initialize_project(path, name = default_name_from_path(path);
293
289
# Instantiate template
294
290
folders, ph_files = insert_folders (path, template, placeholder)
295
291
296
- git && LibGit2. add! (repo, " Project.toml" )
297
- git && LibGit2. add! (repo, " Manifest.toml" )
298
- git && LibGit2. add! (repo, folders... )
299
- placeholder && git && LibGit2. add! (repo, ph_files... )
300
- git && LibGit2. commit (repo, " Folder setup by DrWatson" )
292
+ if git
293
+ LibGit2. add! (repo, " Project.toml" )
294
+ LibGit2. add! (repo, " Manifest.toml" )
295
+ LibGit2. add! (repo, folders... )
296
+ placeholder && LibGit2. add! (repo, ph_files... )
297
+ sig = LibGit2. Signature (" DrWatson" , " no@mail" , round (Int, time ()), 0 )
298
+ LibGit2. commit (repo, " Folder setup by DrWatson" ; author= sig, committer= sig)
299
+ end
301
300
302
301
# Default files
303
302
# chmod is needed, as the file permissions are not set correctly when adding the package with `add`.
@@ -320,8 +319,11 @@ function initialize_project(path, name = default_name_from_path(path);
320
319
w *= compat_entry ()
321
320
write (joinpath (path, " Project.toml" ), w, pro)
322
321
push! (files, " Project.toml" )
323
- git && LibGit2. add! (repo, files... )
324
- git && LibGit2. commit (repo, " File setup by DrWatson" )
322
+ if git
323
+ LibGit2. add! (repo, files... )
324
+ sig = LibGit2. Signature (" DrWatson" , " no@mail" , round (Int, time ()), 0 )
325
+ LibGit2. commit (repo, " File setup by DrWatson" ; author= sig, committer= sig)
326
+ end
325
327
return path
326
328
end
327
329
0 commit comments