: nply/minci

commit db9b13ff45f2a88073aeaf73aad6451276aa21e7
parent 1f885f660e000ef923554b4838fa636be4e2839c
Author: kristapsdz <kristaps@bsd.lv>
Date: Fri, 20 Mar 2020 15:19:48 +0000

Fetch must come after initial clone.
1 file changed, 4 insertions(+), 1 deletion(-)
M
minci.sh
|
5
++++-
diff --git a/minci.sh b/minci.sh
@@ -255,11 +255,14 @@ do
 			if [ -z "$NOOP" ]
 			then
 				cd "$reponame"
-				FETCH_HEAD=$(cut -f1 .git/FETCH_HEAD | head -1) || FETCH_HEAD=""
 			fi
 			# Grabs the newest .git/FETCH_HEAD.
 			run "git fetch origin" "$reponame" || break
 			run "git reset --hard origin/master" "$reponame" || break
+			if [ -z "$NOOP" ]
+			then
+				FETCH_HEAD=$(cut -f1 .git/FETCH_HEAD | head -1) || FETCH_HEAD=""
+			fi
 		fi
 
 		# If the FETCH_HEAD commit doesn't change when we freshen the