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.
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