浏览代码

Use a more resilient "checkout ref" one-liner

Tianon Gravi 11 年之前
父节点
当前提交
21f3f86b86
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      bashbrew/build.sh

+ 1 - 1
bashbrew/build.sh

@@ -209,7 +209,7 @@ while [ "$#" -gt 0 ]; do
 		continue
 	fi
 	
-	( set -x; cd "$gitRepo" && git clean -dfxq && git checkout -q "$gitRef" ) &>> "$thisLog"
+	( set -x; cd "$gitRepo" && git reset -q HEAD && git checkout -q -- . && git clean -dfxq && git checkout -q "$gitRef" -- ) &>> "$thisLog"
 	# TODO git tag
 	
 	if [ ! -d "$gitRepo/$gitDir" ]; then