Meta/update-from-lore: support initial import as well

Junio C Hamano committed Jul 24, 2026 at 13:22 UTC dea7ccfea105b7a3c051b758c08aeacda6839de2
1 file changed +14
update-from-lore.sh
+14
@@ -1,5 +1,18 @@
1 #!/bin/sh
2
3 +afresh () {
4 + if git symbolic-ref -q HEAD
5 + then
6 + echo >&2 "HEAD not detached"
7 + exit 1
8 + fi
9 + b4 am -o- -t "$1" |
10 + tee ./+b4am.mbx |
11 + git am -s3 && rm -f ./+b4am.mbx
12 +
13 + exit $?
14 +}
15 +
16 force=
17 while case "$#" in 0) break;; esac
18 do
@@ -17,6 +30,7 @@ done
30
31 case "$#" in
32 0) : happy ;;
33 +1) afresh "$1" ;;
34 *) echo >&2 "$0: extra arguments" ;;
35 esac
36