diff options
author | Jonathan Bauer | 2020-05-13 18:41:48 +0200 |
---|---|---|
committer | Jonathan Bauer | 2020-05-13 18:41:48 +0200 |
commit | 0c5e81c09be6bb6ba6c1c376d35c95a1132dcb4f (patch) | |
tree | 0c76c558ad4e425830c7326c81ddf14a16d48758 /build-initramfs.sh | |
parent | build-initramfs.sh: --depth implies --single-branch (diff) | |
download | systemd-init-0c5e81c09be6bb6ba6c1c376d35c95a1132dcb4f.tar.gz systemd-init-0c5e81c09be6bb6ba6c1c376d35c95a1132dcb4f.tar.xz systemd-init-0c5e81c09be6bb6ba6c1c376d35c95a1132dcb4f.zip |
build-initramfs.sh: handle non-existing commit ids
Diffstat (limited to 'build-initramfs.sh')
-rwxr-xr-x | build-initramfs.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/build-initramfs.sh b/build-initramfs.sh index 74c95698..8aea10f6 100755 --- a/build-initramfs.sh +++ b/build-initramfs.sh @@ -113,8 +113,15 @@ handler_git() { # manual "shallow clone" since not all server allow it... pushd "$path" - local i=50 + local i=0 + local last_count=0 while ! git rev-parse --quiet --verify $revision^{commit}; do + current_count="$(git rev-list --count --all)" + if [ "$current_count" -eq "$last_count" ]; then + echo "Failed to find '$revision' in '$2'." + exit 1 + fi + last_count="$current_count" git fetch --depth=$(( i+=50 )) done git reset --hard "$revision" |