Skip to content
Snippets Groups Projects
Commit deec8de7 authored by Dato Simó's avatar Dato Simó Committed by Richard Hartmann
Browse files

vcsh: don't allow `clone` to choke on filenames with spaces

By replacing the "for" loop with a "while" loop, it is easy to read
line-oriented output without worrying about spaces. However, now the
loop executes in a subshell, and VCSH_CONFLICT won't be available in
the parent shell. In this case, a trivial, portable solution is to
have the comparison as the last command in the subshell.
parent b4bee06a
No related branches found
No related tags found
No related merge requests found
......@@ -152,12 +152,12 @@ clone() {
exit
fi
git fetch
for object in $(git ls-tree -r origin/master | awk '{print $4}'); do
git ls-tree -r --name-only origin/master | (while read object; do
[ -e "$object" ] &&
error "'$object' exists." &&
VCSH_CONFLICT=1
done
[ "$VCSH_CONFLICT" = '1' ] &&
[ "$VCSH_CONFLICT" = '1' ]) &&
fatal "will stop after fetching and not try to merge!
Once this situation has been resolved, run 'vcsh run $VCSH_REPO_NAME git pull' to finish cloning." 17
git merge origin/master
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment