mirror of
https://github.com/frej/fast-export.git
synced 2026-02-27 06:50:41 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb05ce5b7b | ||
|
|
01d71a2d3f | ||
|
|
1d0f6cb7ca |
@@ -49,9 +49,23 @@ case "$1" in
|
||||
exit 0
|
||||
esac
|
||||
|
||||
cd $(git rev-parse --show-toplevel) \
|
||||
IS_BARE=$(git rev-parse --is-bare-repository) \
|
||||
|| (echo "Could not find git repo" ; exit 1)
|
||||
GIT_DIR=$(git rev-parse --git-dir) || exit 1
|
||||
if test "z$IS_BARE" != ztrue; then
|
||||
# This is not a bare repo, cd to the toplevel
|
||||
TOPLEVEL=$(git rev-parse --show-toplevel) \
|
||||
|| (echo "Could not find git repo toplevel" ; exit 1)
|
||||
cd $TOPLEVEL || exit 1
|
||||
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
|
||||
@@ -66,6 +80,7 @@ do
|
||||
--force)
|
||||
# pass --force to git-fast-import and hg-fast-export.py
|
||||
GFI_OPTS="$GFI_OPTS --force"
|
||||
IGNORECASEWARN="";
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
@@ -79,6 +94,22 @@ 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
|
||||
cp "$GIT_DIR/$PFX-$i" "$GIT_DIR/$PFX-$i~"
|
||||
fi
|
||||
done
|
||||
|
||||
# for convenience: get default repo from state file
|
||||
if [ x"$REPO" = x -a -f "$GIT_DIR/$PFX-$SFX_STATE" ] ; then
|
||||
REPO="`grep '^:repo ' "$GIT_DIR/$PFX-$SFX_STATE" | cut -d ' ' -f 2`"
|
||||
|
||||
10
hg-reset.sh
10
hg-reset.sh
@@ -24,9 +24,15 @@ Options:
|
||||
-r Mercurial repository to use
|
||||
"
|
||||
|
||||
cd $(git rev-parse --show-toplevel) \
|
||||
IS_BARE=$(git rev-parse --is-bare-repository) \
|
||||
|| (echo "Could not find git repo" ; exit 1)
|
||||
GIT_DIR=$(git rev-parse --git-dir) || exit 1
|
||||
if test "z$IS_BARE" != ztrue; then
|
||||
# This is not a bare repo, cd to the toplevel
|
||||
TOPLEVEL=$(git rev-parse --show-toplevel) \
|
||||
|| (echo "Could not find git repo toplevel" ; exit 1)
|
||||
cd $TOPLEVEL || exit 1
|
||||
fi
|
||||
GIT_DIR=$(git rev-parse --git-dir) || (echo "Could not find git repo" ; exit 1)
|
||||
|
||||
while case "$#" in 0) break ;; esac
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user