chiark / gitweb /
mdw/build: Check out the `mdw-build' branch by hand.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 10 Apr 2020 16:51:22 +0000 (17:51 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 10 Apr 2020 16:51:22 +0000 (17:51 +0100)
Later versions of Git leave the working tree empty after `git checkout
-b'.  Instead, just go through the necessary motions using the plumbing-
level commands.

bin/mdw-build

index 2af71e34087f55e7ace8a13eb0347a125e2188b5..6a5a28ac1f241e5da890385296bf220b27ff0747 100755 (executable)
@@ -302,7 +302,10 @@ case "$checkout" in
     run git clone -sn $srcpath/.git _source
     assign srcpath $releasepath/_source
     cd $srcpath
-    run git checkout -b mdw-build $checkoutrev
+    run git update-ref refs/heads/mdw-build $checkoutrev ""
+    run git symbolic-ref HEAD refs/heads/mdw-build
+    run git read-tree --reset refs/heads/mdw-build
+    run git checkout-index -afu
     assign gitversion "$(git describe --abbrev=4)"
     ;;
 esac