Skip to content

Commit

Permalink
Correctly handles BRANCH being a tag
Browse files Browse the repository at this point in the history
Fixes #837
  • Loading branch information
remram44 committed Jan 29, 2015
1 parent 6dd4803 commit 1ddc15d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CMake/cdat_modules_extra/git_clone.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

cd "@CMAKE_INSTALL_PREFIX@"
"@GIT_EXECUTABLE@" clone --no-checkout --depth 1 -b @BRANCH@ @GIT_URL@ "@GIT_TARGET@"
"@GIT_EXECUTABLE@" checkout origin/@BRANCH@
if [ $("@GIT_EXECUTABLE@" cat-file -t @BRANCH@) = tag ]; then
"@GIT_EXECUTABLE@" checkout @BRANCH@
else
"@GIT_EXECUTABLE@" checkout origin/@BRANCH@
fi
6 changes: 5 additions & 1 deletion CMake/cdat_modules_extra/git_update.sh.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/sh
cd "@SOURCE_DIR@"
"@GIT_EXECUTABLE@" fetch origin --prune
"@GIT_EXECUTABLE@" checkout -f origin/@BRANCH@
if [ $("@GIT_EXECUTABLE@" cat-file -t @BRANCH@) = tag ]; then
"@GIT_EXECUTABLE@" checkout -f @BRANCH@
else
"@GIT_EXECUTABLE@" checkout -f origin/@BRANCH@
fi

0 comments on commit 1ddc15d

Please sign in to comment.