@@ -360,21 +360,30 @@ createSourceBranch() {
360360 createBranch " ${g_sSourceBranch} " " ${g_sRootBranch} "
361361}
362362
363+ createBranchName () {
364+ local sFile
365+
366+ sFile=" $( basename $1 ) "
367+
368+ echo " ${g_sSourceBranch} _${sFile} "
369+ }
370+
363371createSplitBranch () {
364372 printStatus " Creating separate branch to split file '${1} '"
365- createBranch " ${g_sSourceBranch} _ ${1} " " ${g_sSourceBranch} "
373+ createBranch " $( createBranchName ${1} ) " " ${g_sSourceBranch} "
366374}
367375
368376checkoutBranch () {
369- printStatus " Switching back to ${2} branch"
377+ printStatus " Switching to ${2} branch"
370378 git checkout " ${1} " | indent
371379}
372380
373381checkoutSplitBranch () {
374382 local sBranchName sFile
375383
376384 sFile=" ${1} "
377- sBranchName=" ${g_sSourceBranch} _${sFile} "
385+
386+ sBranchName=" $( createBranchName ${sFile} ) "
378387
379388 checkoutBranch " ${sBranchName} " ' split'
380389}
@@ -392,7 +401,7 @@ mergeSplitBranch() {
392401 local -i iResult=0
393402 sFile=" ${1} "
394403
395- sBranchName=" ${g_sSourceBranch} _ ${sFile} "
404+ sBranchName=" $( createBranchName ${sFile} ) "
396405
397406 printTopic " Merging branch '${sBranchName} ' back into '$( getCurrentBranch) '"
398407
@@ -524,15 +533,15 @@ runCleanup() {
524533 git branch -D " ${g_sSourceBranch} " | indent
525534
526535 for sFile in ${g_sSplitDirectory} /* ; do
527- sBranchName=" ${g_sSourceBranch} _ ${sFile} "
536+ sBranchName=" $( createBranchName ${sFile} ) "
528537
529538 # shellcheck disable=SC2086
530539 if [[ -n " $( git show-ref refs/heads/${sBranchName} ) " ]]; then
531540 # Branch exists
532541 git branch -D " ${sBranchName} " | indent
533542 fi
534543 done
535- sBranchName=" ${g_sSourceBranch} _ ${g_sSourceFileName} "
544+ sBranchName=" $( createBranchName ${g_sSourceFileName} ) "
536545
537546 # shellcheck disable=SC2086
538547 if [[ -n " $( git show-ref refs/heads/${sBranchName} ) " ]]; then
0 commit comments