Skip to content
Permalink
Browse files
tools: Tweak auto build script
fetch with --prune option to remove deleted references
git reset --hard instead of git pull in case branch was rewritten
  • Loading branch information
paulscode committed Jan 10, 2015
1 parent c3456b0 commit 1b22f4c6c11523ef2d59b141c39b083dfd96e791
Showing 1 changed file with 3 additions and 3 deletions.
@@ -16,7 +16,7 @@ localBranches=($(git branch | awk -F ' +' '! /\(no branch\)/ {print $2}'))
remoteBranches=($(git branch -r | awk -F ' origin/+' '! /\->/ {print $2}'))

echo "Executing git fetch"
git fetch --all
git fetch --prune --all

exitCode=0
# Loop through the remote branches (these are the only ones that may have changed)
@@ -39,8 +39,8 @@ for currentBranch in "${remoteBranches[@]}"; do
oldRevision=`git rev-parse --short HEAD`
fi

echo "Executing git pull"
git pull
echo "Executing git reset"
cmd="git reset --hard origin/""$currentBranch"; $cmd
newRevision=`git rev-parse --short HEAD`

# Compare local and remote revision numbers, and build if there are changes

0 comments on commit 1b22f4c

Please sign in to comment.