Skip to content

Commit 7a956da

Browse files
added store current branch.
1 parent 66655bc commit 7a956da

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/devcontainers/base/src/.devcontainer/nhsnotify/postcreatecommand.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ echo "created destination directory $DEST"
3131
echo "Cloning repository from $REPO to $DEST"
3232
git clone $REPO $DEST
3333
echo "cloned repository $REPO to $DEST"
34+
35+
CURRENT_BRANCH=$(git symbolic-ref --short HEAD)
36+
echo "current branch is $CURRENT_BRANCH"
3437
git switch -C $UPDATE_BRANCH
3538

3639
\cp -rf $DEST/scripts ./scripts
@@ -40,7 +43,7 @@ git switch -C $UPDATE_BRANCH
4043
git add .
4144
git commit -m "Update default files from $REPO" || echo "No changes to commit"
4245

43-
git switch -
46+
git switch $CURRENT_BRANCH
4447
git merge $UPDATE_BRANCH -m "Merge default files from $REPO"
4548
echo "$REPO template complete"
4649

0 commit comments

Comments
 (0)