Show warning when core.ignoreCase is true

When core.ignoreCase is true, which it is by default on OSX,
fast-import will produce empty changesets for renames that just change
the case of the file name. As this most probably is not the desired
behavior, trigger an error but allow the conversion to proceed if
--force is used.
This commit is contained in:
Emilian Bold
2016-12-30 21:47:01 +02:00
committed by Frej Drejhammar
parent 01d71a2d3f
commit fb05ce5b7b

View File

@@ -59,6 +59,14 @@ if test "z$IS_BARE" != ztrue; then
fi
GIT_DIR=$(git rev-parse --git-dir) || (echo "Could not find git repo" ; exit 1)
IGNORECASEWARN=""
IGNORECASE=`git config core.ignoreCase`
if [ "true" = "$IGNORECASE" ]; then
IGNORECASEWARN="true"
fi;
while case "$#" in 0) break ;; esac
do
case "$1" in
@@ -72,6 +80,7 @@ do
--force)
# pass --force to git-fast-import and hg-fast-export.py
GFI_OPTS="$GFI_OPTS --force"
IGNORECASEWARN="";
break
;;
-*)
@@ -85,6 +94,15 @@ do
shift
done
if [ ! -z "$IGNORECASEWARN" ]; then
echo "Error: The option core.ignoreCase is set to true in the git"
echo "repository. This will produce empty changesets for renames that just"
echo "change the case of the file name."
echo "Use --force to skip this check or change the option with"
echo "git config core.ignoreCase false"
exit 1
fi;
# Make a backup copy of each state file
for i in $SFX_STATE $SFX_MARKS $SFX_MAPPING $SFX_HEADS ; do
if [ -f "$GIT_DIR/$PFX-$i" ] ; then