diff options
author | tv <tv@krebsco.de> | 2017-10-17 20:02:11 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2017-10-17 20:21:41 +0200 |
commit | ca12db51773bfcc3247842fb68a7a896bd0b04d1 (patch) | |
tree | 1e4f54acbea860fe5f5704b880bd883afd5b1552 /lib | |
parent | e29490e2366d98ee8f1f00e5215a88851c8118f6 (diff) |
git: fetch only if commit is not in historyv1.2.5prism/staging/git-fetch
Diffstat (limited to 'lib')
-rw-r--r-- | lib/populate.jq | 4 |
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", |