X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/45d958ca5f802a6ca99b910186b82608af82e8c9..980cf95c728f02610649fc4dee37a24f00d8dfd3:/vcsh diff --git a/vcsh b/vcsh index 1d4233d..d583dbc 100755 --- a/vcsh +++ b/vcsh @@ -62,9 +62,9 @@ init() { cd "$GIT_WORK_TREE" git init git config core.worktree "$GIT_WORK_TREE" - git config core.excludesfile ".gitignore.d/$REPO_NAME" - touch "$HOME/.gitignore.d/$REPO_NAME" - git add "$HOME/.gitignore.d/$REPO_NAME" + git config core.excludesfile ".gitignore.d/$VCSH_REPO_NAME" + touch "$HOME/.gitignore.d/$VCSH_REPO_NAME" + git add "$HOME/.gitignore.d/$VCSH_REPO_NAME" verbose "init() end" } @@ -214,12 +214,13 @@ elif [ "$VCSH_COMMAND" = 'seed-gitignore' ]; then [ "$file" = "$new" ] && break file="$new" done; - done | sort -u | sed 's/^/!/') + done | sort -u) tempfile=$(mktemp) || (echo "$SELF: fatal: could not create tempfile" && exit 1) echo '*' > "$tempfile" for gitignore in $gitignores; do - echo "$gitignore" >> "$tempfile" + echo "$gitignore" | sed 's/^/!/' >> "$tempfile" + [ -d "$gitignore" ] && echo "$gitignore/*" | sed 's/^/!/'>> "$tempfile" done diff -N "$tempfile" "$HOME/.gitignore.d/$VCSH_REPO_NAME" > /dev/null && rm -f "$tempfile" &&