diff options
Diffstat (limited to 'pkgs/populate/src/sh.rs')
| -rw-r--r-- | pkgs/populate/src/sh.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/populate/src/sh.rs b/pkgs/populate/src/sh.rs index 77d2463..1f27b6b 100644 --- a/pkgs/populate/src/sh.rs +++ b/pkgs/populate/src/sh.rs @@ -547,7 +547,9 @@ deliver_git() { } if printf %s "$ref" | grep -Eqx '[0-9a-f]{4,40}'; then hash=$ref - if ! test "$(git log --format=%H -1)" = "$hash"; then + # Quietly, also in a repository without commits yet, e.g. a shallow + # one git init just made. + if ! test "$(git rev-parse --verify --quiet HEAD)" = "$hash"; then if test -n "$fetch_always"; then fetch_commit elif ! git log -1 "$hash" >/dev/null 2>&1; then |
