Fixes #5361 - Simplify repo-merge.sh by using function instead of duplicated code
Refs #5361 - Reindent repo-merge.sh
Merge pull request #18 from nperron/ust_5360/int/5361_simplify_repo_merge_script

Fixes #5361 - Simplify repo-merge.sh by using function instead of duplicated code