Skip to content

Add support for paths which include spaces. #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions git-svn-migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ fi
# Process each URL in the repository list.
pwd=`pwd`;
tmp_destination="$pwd/tmp-git-repo";
mkdir -p $destination;
destination=`cd $destination; pwd`; #Absolute path.
mkdir -p "$destination";
destination=`cd "$destination"; pwd`; #Absolute path.

# Ensure temporary repository location is empty.
if [[ -e $tmp_destination ]]; then
Expand All @@ -191,38 +191,38 @@ do
echo "Processing \"$name\" repository at $url..." >&2;

# Init the final bare repository.
mkdir $destination/$name.git;
cd $destination/$name.git;
mkdir "$destination/$name.git";
cd "$destination/$name.git";
git init --bare $gitinit_params;
git symbolic-ref HEAD refs/heads/trunk;

# Clone the original Subversion repository to a temp repository.
cd $pwd;
cd "$pwd";
echo "- Cloning repository..." >&2;
git svn clone $url -A $authors_file --authors-prog=$dir/svn-lookup-author.sh --stdlayout --quiet $gitsvn_params $tmp_destination;
git svn clone "$url" -A "$authors_file" --authors-prog="$dir/svn-lookup-author.sh" --stdlayout --quiet $gitsvn_params "$tmp_destination";

# Create .gitignore file.
echo "- Converting svn:ignore properties into a .gitignore file..." >&2;
if [[ $ignore_file != '' ]]; then
cp $ignore_file $tmp_destination/.gitignore;
cp "$ignore_file" "$tmp_destination/.gitignore";
fi
cd $tmp_destination;
cd "$tmp_destination";
git svn show-ignore --id trunk >> .gitignore;
git add .gitignore;
git commit --author="git-svn-migrate <[email protected]>" -m 'Convert svn:ignore properties to .gitignore.';

# Push to final bare repository and remove temp repository.
echo "- Pushing to new bare repository..." >&2;
git remote add bare $destination/$name.git;
git remote add bare "$destination/$name.git";
git config remote.bare.push 'refs/remotes/*:refs/heads/*';
git push bare;
# Push the .gitignore commit that resides on master.
git push bare master:trunk;
cd $pwd;
rm -r $tmp_destination;
cd "$pwd";
rm -r "$tmp_destination";

# Rename Subversion's "trunk" branch to Git's standard "master" branch.
cd $destination/$name.git;
cd "$destination/$name.git";
git branch -m trunk master;

# Remove bogus branches of the form "name@REV".
Expand All @@ -242,4 +242,4 @@ do
done

echo "- Conversion completed at $(date)." >&2;
done < $url_file
done < "$url_file"