Skip to content

Commit de61b65

Browse files
committed
Merge pull request #993 from UV-CDAT/fix-git-update
Fix git clone & update helper scripts
2 parents 3bf31ca + 4f89f6e commit de61b65

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/bin/sh
22

3-
cd @CMAKE_INSTALL_PREFIX@
4-
"@GIT_EXECUTABLE@" clone --depth 1 -b @BRANCH@ @GIT_URL@ @GIT_TARGET@
3+
cd "@CMAKE_INSTALL_PREFIX@"
4+
"@GIT_EXECUTABLE@" clone --no-checkout --depth 1 -b @BRANCH@ @GIT_URL@ "@GIT_TARGET@"
5+
cd "@GIT_TARGET@"
6+
if [ "$("@GIT_EXECUTABLE@" cat-file -t @BRANCH@)" = tag ]; then
7+
"@GIT_EXECUTABLE@" checkout @BRANCH@
8+
else
9+
"@GIT_EXECUTABLE@" checkout origin/@BRANCH@
10+
fi
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#!/bin/sh
2-
cd @SOURCE_DIR@
3-
git fetch origin --prune
4-
branch_name=$(git symbolic-ref HEAD | sed -e 's,.*\/\(.*\),\1,')
5-
if [ $? = 0 -a "${branch_name}" != "@BRANCH@" ]; then
6-
git checkout -f @BRANCH@
2+
cd "@SOURCE_DIR@"
3+
"@GIT_EXECUTABLE@" fetch origin --prune
4+
if [ "$("@GIT_EXECUTABLE@" cat-file -t @BRANCH@)" = tag ]; then
5+
"@GIT_EXECUTABLE@" checkout -f @BRANCH@
6+
else
7+
"@GIT_EXECUTABLE@" checkout -f origin/@BRANCH@
78
fi
8-
git reset --hard origin/@BRANCH@
9-

0 commit comments

Comments
 (0)