Skip to content

Commit 8ac6838

Browse files
authored
Fall back on global git config (#277)
* Fall back to global name and email git config settings * Bump patch version
1 parent dd973f3 commit 8ac6838

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DrWatson"
22
uuid = "634d3b9d-ee7a-5ddf-bec9-22491ea816e1"
33
repo = "https://github.com/JuliaDynamics/DrWatson.jl.git"
4-
version = "2.2.0"
4+
version = "2.2.1"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

src/project_setup.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,10 @@ function initialize_project(path, name = default_name_from_path(path);
256256
if git
257257
repo = LibGit2.init(path)
258258
gc = LibGit2.GitConfig(repo)
259-
LibGit2.get(gc, "user.name", false) || LibGit2.set!(gc, "user.name", "DrWatson")
260-
LibGit2.get(gc, "user.email", false) || LibGit2.set!(gc, "user.email", "no@mail")
259+
LibGit2.get(gc, "user.name", LibGit2.getconfig("user.name", false)) ||
260+
LibGit2.set!(gc, "user.name", "DrWatson")
261+
LibGit2.get(gc, "user.email", LibGit2.getconfig("user.email", false)) ||
262+
LibGit2.set!(gc, "user.email", "no@mail")
261263
LibGit2.commit(repo, "Initial commit")
262264
end
263265

0 commit comments

Comments
 (0)