diff --git a/cg-restore b/cg-restore index 348f552..e318351 100755 --- a/cg-restore +++ b/cg-restore @@ -89,7 +89,12 @@ if [ "$ARGS" ]; then # TODO: Use git-update-index --index-info when we # will depend on git new enough. --pasky if ! git-update-index --add --cacheinfo "$mode" "$id" "$name"; then - echo "Error: Cannot mark ${file#$_git_relpath} for update" >&2 + echo "Error: Cannot mark ${name#$_git_relpath} for update" >&2 + ret=1 + continue + fi + if ! git-checkout-index -u $force -- "$name"; then + echo "Error: Cannot checkout ${name#$_git_relpath}" >&2 ret=1 continue fi @@ -101,7 +106,6 @@ if [ "$ARGS" ]; then # exit $? #} fi - git-checkout-index -u $force -- "${files[@]}" || ret=1 elif [ "$objtype" = "blob" ]; then [ "${#files[@]}" -gt 1 ] && echo "Warning: Restoring multiple files to a single blob" >&2