mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Merge pull request #787 from rvbuelow/patch-1
Use GIT_DIR environment variable to to set .git directory
This commit is contained in:
commit
fd36fc0ea2
|
|
@ -1,5 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
: ${GIT_DIR:=.git}
|
||||
|
||||
function show_contents {
|
||||
local file="${2/#~/$HOME}"
|
||||
if [ -f "$file" ]; then
|
||||
|
|
@ -37,13 +39,13 @@ function add_local {
|
|||
|
||||
function show_private {
|
||||
cd "$(git root)"
|
||||
show_contents Private .git/info/exclude
|
||||
show_contents Private "${GIT_DIR}/info/exclude"
|
||||
}
|
||||
|
||||
function add_private {
|
||||
cd "$(git root)"
|
||||
test -d .git/info || mkdir -p .git/info
|
||||
add_patterns .git/info/exclude "$@"
|
||||
test -d "${GIT_DIR}/info" || mkdir -p "${GIT_DIR}/info"
|
||||
add_patterns "${GIT_DIR}/info/exclude" "$@"
|
||||
}
|
||||
|
||||
function add_patterns {
|
||||
|
|
|
|||
Loading…
Reference in a new issue