23 lines
548 B
Bash
Executable File
23 lines
548 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
add-git-merge() {
|
|
if [[ -z "$1" ]]; then
|
|
echo '$1/remote is empty.' >&2
|
|
exit 1
|
|
fi
|
|
if [[ -z "$2" ]]; then
|
|
echo '$2/merge is empty.' >&2
|
|
exit 1
|
|
fi
|
|
if [[ -z "$3" ]]; then
|
|
echo '$3/path is empty.' >&2
|
|
exit 1
|
|
fi
|
|
|
|
local remote_name="$1"
|
|
local merge_ref="$2"
|
|
local submodule_path="$3"
|
|
|
|
echo "Add merge '${remote_name}=$merge_ref' entry for $submodule_path"
|
|
git config -f .gitmodules --add merge."$submodule_path"."$remote_name" "$merge_ref"
|
|
} |