]> git.corax.cc Git - toolbox/commitdiff
include/git: Add module for interaction with git repositories
authorMatthias Kruk <m@m10k.eu>
Sun, 8 Aug 2021 06:30:36 +0000 (15:30 +0900)
committerMatthias Kruk <m@m10k.eu>
Sun, 8 Aug 2021 06:30:36 +0000 (15:30 +0900)
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.

include/git.sh

index 620c62a690025f05b03620e02e28580d04fe15d5..6fbf7306592869172ca89c0d322c8fda0d7c8ba9 100644 (file)
@@ -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