mirror of
https://github.com/frej/fast-export.git
synced 2026-02-07 21:59:02 +01:00
Make backup copies of state files
If a conversion fails we want the previous state files preserved, both for debugging but also to allow us to recover.
This commit is contained in:
@@ -85,6 +85,13 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
# 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`"
|
||||
|
||||
Reference in New Issue
Block a user