From: Matthias Kruk Date: Sun, 8 Aug 2021 06:30:36 +0000 (+0900) Subject: include/git: Add module for interaction with git repositories X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=44f3c062000d6717b13c7808228509ec4422ceff;p=toolbox include/git: Add module for interaction with git repositories This commit adds a module that can be used to perform operations such as cloning, merging, pushing, etc on a git repository without having to change directories. --- diff --git a/include/git.sh b/include/git.sh index 620c62a..6fbf730 100644 --- a/include/git.sh +++ b/include/git.sh @@ -42,7 +42,7 @@ git_clone() { git_current_branch() { local repository="$1" - if ! grep -oP "refs/heads/\K.*" < "$repository/.git/HEAD"; then + if ! grep -oP "refs/heads/\\K.*" < "$repository/.git/HEAD"; then log_error "Could not get current branch of $repository" return 1 fi