We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db71be5 commit f95e339Copy full SHA for f95e339
bin/git-cp
@@ -38,6 +38,12 @@ else
38
exit 40
39
fi
40
41
+ MERGE_OPT=
42
+ ff=$(git config --get merge.ff)
43
+ if [[ "$ff" == "only" ]]; then
44
+ MERGE_OPT="--ff"
45
+ fi
46
+
47
echo "Copying $CURRENT_FILENAME into $DESTINATION_FILENAME"
48
49
INTERMEDIATE_FILENAME="${CURRENT_FILENAME//\//__}-move-to-${DESTINATION_FILENAME//\//__}"
@@ -59,7 +65,8 @@ else
59
65
git reset --hard HEAD^
60
66
61
67
# We keep both files
62
- git merge "${DESTINATION_SAVED}" "${INTERMEDIATE_SAVED}" -m "Duplicate ${CURRENT_FILENAME} history."
68
+ # shellcheck disable=SC2086
69
+ git merge $MERGE_OPT "${DESTINATION_SAVED}" "${INTERMEDIATE_SAVED}" -m "Duplicate ${CURRENT_FILENAME} history."
63
70
64
71
# We get back our original name
72
git mv "${INTERMEDIATE_FILENAME}" "${CURRENT_FILENAME}"
0 commit comments