I try to count some files in conflicts :
let initialConflicts=`git diff --name-only --diff-filter=U | wc -l`
The problem is : if there is no conflict, the result of git diff
is empty and wc -l
hangs. It seems to come from either a missing option in git diff
or in wc -l
. This small script reproduces the problem :
set -euo pipefail
IFS=$'\n\t'
echo $SHELL
echo "Before counting"
let test=`echo -n "" | wc -l`
echo "After counting"
Here, the line "After counting" does not appear.