summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/populate.jq4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/populate.jq b/lib/populate.jq
index e269d05..d7cf964 100644
--- a/lib/populate.jq
+++ b/lib/populate.jq
@@ -65,7 +65,9 @@ def git_script:
@sh " hash=$src_ref",
@sh " if ! test \"$(git log --format=%H -1)\" = \"$hash\"; then",
- @sh " git fetch origin",
+ @sh " if ! git log -1 \"$hash\" >/dev/null 2>&1; then",
+ @sh " git fetch origin",
+ @sh " fi",
@sh " git checkout \"$hash\" -- \"$dst_dir\"",
@sh " git checkout -f \"$hash\"",
@sh " fi",