Skip to content

Commit 484cbec

Browse files
committed
Don't use confusing (GIT_DIR) variable name
$GIT_DIR is used for the actual .git dir, not the root of the repository. So pick a better variablename
1 parent 2eafcd1 commit 484cbec

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

git-ignore-wizard

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ dirname=` dirname $file`
2525
basename=`basename $file`
2626
case $type in
2727
.gitignore-root)
28-
GIT_DIR=`git root $file` || exit 2
28+
root=`git root $file` || exit 2
2929
dirname=$(readlink -f $dirname)
30-
relative_dir=$(echo $dirname | sed "s#^$GIT_DIR##") # ie: /src
31-
echo "$relative_dir/$basename" >> $GIT_DIR/.gitignore
30+
relative_dir=$(echo $dirname | sed "s#^$root##") # ie: /src
31+
echo "$relative_dir/$basename" >> $root/.gitignore
3232
;;
3333
.gitignore-dirname)
3434
git root $file >/dev/null || exit 2
3535
echo "$basename" >> $dirname/.gitignore
3636
;;
3737
exclude)
38-
GIT_DIR=`git root $file` || exit 2
38+
root=`git root $file` || exit 2
3939
dirname=$(readlink -f $dirname)
40-
relative_dir=$(echo $dirname | sed "s#^$GIT_DIR##")
41-
echo "$relative_dir/$basename" >> $GIT_DIR/info/exclude
40+
relative_dir=$(echo $dirname | sed "s#^$root##")
41+
echo "$relative_dir/$basename" >> $root/info/exclude
4242
;;
4343
.gitconfig)
4444
#TODO. git config --get-all ?, then another dmenu? how many such config keys are allowed?

0 commit comments

Comments
 (0)