Merge pull request #95 from shadone/blackbox_initialize_ignore_file_fix

Fixed initialization
This commit is contained in:
Tom Limoncelli
2015-06-27 13:14:49 -04:00
2 changed files with 19 additions and 3 deletions

View File

@@ -471,6 +471,19 @@ function vcs_remove_unknown() {
: :
} }
# Get a path for the ignore file if possible in current vcs
function vcs_ignore_file_path() {
vcs_ignore_file_path_$VCS_TYPE
}
# Mercurial
function vcs_ignore_file_path_hg() {
echo "$REPOBASE/.hgignore"
}
# Git
function vcs_ignore_file_path_git() {
echo "$REPOBASE/.gitignore"
}
# Ignore a file in a repo. If it was already ignored, this is a no-op. # Ignore a file in a repo. If it was already ignored, this is a no-op.
function vcs_ignore() { function vcs_ignore() {
@@ -481,11 +494,11 @@ function vcs_ignore() {
} }
# Mercurial # Mercurial
function vcs_ignore_hg() { function vcs_ignore_hg() {
vcs_ignore_generic_file "$REPOBASE/.hgignore" "$file" vcs_ignore_generic_file "$(vcs_ignore_file_path)" "$file"
} }
# Git # Git
function vcs_ignore_git() { function vcs_ignore_git() {
vcs_ignore_generic_file "$REPOBASE/.gitignore" "$file" vcs_ignore_generic_file "$(vcs_ignore_file_path)" "$file"
} }
# Subversion # Subversion
function vcs_ignore_svn() { function vcs_ignore_svn() {

View File

@@ -28,7 +28,10 @@ vcs_ignore keyrings/live/pubring.gpg~ keyrings/live/pubring.kbx~ keyrings/live/s
mkdir -p "${KEYRINGDIR}" mkdir -p "${KEYRINGDIR}"
vcs_add "${KEYRINGDIR}" vcs_add "${KEYRINGDIR}"
touch "$BLACKBOXDATA/$BB_ADMINS_FILE" "$BLACKBOXDATA/$BB_FILES_FILE" touch "$BLACKBOXDATA/$BB_ADMINS_FILE" "$BLACKBOXDATA/$BB_FILES_FILE"
vcs_add "$IGNOREFILE" "$BLACKBOXDATA/$BB_ADMINS_FILE" "$BLACKBOXDATA/$BB_FILES_FILE" vcs_add "$BLACKBOXDATA/$BB_ADMINS_FILE" "$BLACKBOXDATA/$BB_FILES_FILE"
IGNOREFILE="$(vcs_ignore_file_path)"
test -f "$IGNOREFILE" && vcs_add "$IGNOREFILE"
# Make a suggestion: # Make a suggestion:
echo echo