diff options
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" |