Skip to content
Merged
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions bin/git-cp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ else
exit 40
fi

DESTINATION_DIR="$(dirname "$DESTINATION_FILENAME")"
if [ ! -d "$DESTINATION_DIR" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use mkdir -p directly as the cmd won't return error if the dir exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. Removed this check.

echo "Creating destination directory: $DESTINATION_DIR"
mkdir -p "$DESTINATION_DIR"
if [ $? -ne 0 ]; then
echo 1>&2 "Failed to create destination directory: $DESTINATION_DIR"
exit 80
fi
fi

MERGE_OPT=
ff=$(git config --get merge.ff)
if [[ "$ff" == "only" ]]; then
Expand Down