Fixed: Replace SvnCheckout in Gradle (OFBIZ-12868)

Fixes issues while switching branches
diff --git a/pullAllPluginsSource.sh b/pullAllPluginsSource.sh
index eaa5f7e..fd69ddc 100755
--- a/pullAllPluginsSource.sh
+++ b/pullAllPluginsSource.sh
@@ -22,6 +22,7 @@
         rm -rf plugins
 fi
 
+# Get the branch used by the framework
 git branch --show-current > temp.txt
 branch=$(cat temp.txt)
 rm temp.txt
@@ -30,9 +31,9 @@
 cd plugins
 
 # By default the clone branch is trunk
-if [ ! trunk == "$branch" ]
+if [ ! $branch = trunk ]
     then
-        git switch -c "$branch" --track origin/"$branch"
+        git switch "$branch"
 fi
 
 # remove .git, in this case it's big useless information
diff --git a/pullPluginSource.sh b/pullPluginSource.sh
index c4de388..cfe8fdf 100644
--- a/pullPluginSource.sh
+++ b/pullPluginSource.sh
@@ -39,13 +39,16 @@
 
 # Add the plugin
 git sparse-checkout add "$1"
+
+# Get the branch used in framework
+cd ..
 git branch --show-current > temp.txt
 branch=$(cat temp.txt)
 rm temp.txt
 
 # By default the clone branch is trunk
-if [ ! trunk == "$branch" ]
+if [ ! "$branch" = trunk ]
     then
-        call git switch -c "$1" --track origin/"$1"
+        git switch "$branch"
 fi
 cd ..