From 4c011dfee6b65f9ba1beda81be058f7d835e7d69 Mon Sep 17 00:00:00 2001 From: Andrei Neculau Date: Wed, 19 Dec 2018 10:39:11 +0100 Subject: [PATCH] silence "fatal: no such section: " messages 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 --- transcrypt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/transcrypt b/transcrypt index a0b562d..91f69e7 100755 --- a/transcrypt +++ b/transcrypt @@ -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 } @@ -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