浏览代码

Merge pull request #8215 from richardkchapman/git-fetch

HPCC-14901 Git hook does not properly update the local bare repository

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 9 年之前
父节点
当前提交
31bf826e20
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      ecl/eclccserver/vchooks/git.sh

+ 3 - 3
ecl/eclccserver/vchooks/git.sh

@@ -114,10 +114,10 @@ function fetch_repo {
     if [ -n "$fetch_needed" ]; then
         if [ -n "$GIT_VERBOSE" ]; then
             echo "GIT: using directory $git_directory" 1>&2
-            echo "GIT: Running git fetch $git_url" 1>&2
-            git fetch $git_url 1>&2
+            echo "GIT: Running git fetch $git_url +refs/heads/*:refs/heads/* --prune" 1>&2
+            git fetch $git_url +refs/heads/*:refs/heads/* --prune 1>&2
         else
-            git fetch $git_url 2>&1 >/dev/null
+            git fetch $git_url +refs/heads/*:refs/heads/* --prune 2>&1 >/dev/null
         fi
         if [ $? -ne 0 ]; then
             echo "Failed to run git fetch $git_url" 1>&2