We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 386981b commit 6a21eadCopy full SHA for 6a21ead
1 file changed
git-coauthor
@@ -13,6 +13,12 @@ function err() {
13
14
function author_create() {
15
local -r author="$1"
16
+
17
+ if author_exact_match "${author}"; then
18
+ err "author already exists"
19
+ return 1
20
+ fi
21
22
git config --global --add coauthor.author "${author}"
23
}
24
@@ -29,6 +35,14 @@ function author_list() {
29
35
git config --global --get-all coauthor.author
30
36
31
37
38
+function author_exact_match() {
39
+ local -r query="$1"
40
41
+ author_list | grep -i -m 1 -E "^${query}$"
42
43
+ return $?
44
+}
45
32
46
function author_match() {
33
47
local -r query="$1"
34
48
local match
0 commit comments