Skip to content

Commit

Permalink
silence "fatal: no such section: <name>" messages
Browse files Browse the repository at this point in the history
stemming from `git config --remove-section` commands

git 2.18+ (Q2 2018) will remove empty sections on its own
as per https://stackoverflow.com/a/50274206/465684
  • Loading branch information
andreineculau authored and elasticdog committed May 26, 2019
1 parent 9ee68cf commit 9a8a1f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions transcrypt
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,15 @@ display_configuration() {

# remove transcrypt-related settings from the repository's git config
clean_gitconfig() {
git config --remove-section transcrypt
git config --remove-section filter.crypt
git config --remove-section diff.crypt
git config --remove-section transcrypt 2> /dev/null
git config --remove-section filter.crypt 2> /dev/null
git config --remove-section diff.crypt 2> /dev/null
git config --unset merge.renormalize

# remove the merge section if it's now empty
local merge_values=$(git config --get-regex --local 'merge\..*')
if [[ ! $merge_values ]]; then
git config --remove-section merge
git config --remove-section merge 2> /dev/null
fi
}

Expand Down Expand Up @@ -471,7 +471,7 @@ uninstall_transcrypt() {
# remove the alias section if it's now empty
local alias_values=$(git config --get-regex --local 'alias\..*')
if [[ ! $alias_values ]]; then
git config --remove-section alias
git config --remove-section alias 2> /dev/null
fi

# remove any defined crypt patterns in gitattributes
Expand Down

0 comments on commit 9a8a1f4

Please sign in to comment.