diff options
author | tv <tv@krebsco.de> | 2015-06-28 14:54:46 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2015-06-28 14:54:46 +0200 |
commit | d503dbd4ff1f225f4685831e2354b36d96e70996 (patch) | |
tree | 5317f46106401bb46d738e0f1e32f8ed97c9712d /bin | |
parent | c88ea41439751c2268f5234defd10eddfc987baf (diff) |
fetchgit: rev-parse using --verify
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fetchgit | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/fetchgit b/bin/fetchgit index ffd7e74..7862989 100755 --- a/bin/fetchgit +++ b/bin/fetchgit @@ -35,8 +35,8 @@ work_git() { is_up_to_date() { test -d "$cache_dir" && test -d "$work_dir" && - test "$(cache_git rev-parse "$git_rev")" = "$git_rev" && - test "$(work_git rev-parse HEAD)" = "$git_rev" + test "$(cache_git rev-parse --verify "$git_rev")" = "$git_rev" && + test "$(work_git rev-parse --verify HEAD)" = "$git_rev" } # Notice how the remote name "origin" has been chosen arbitrarily. @@ -54,7 +54,7 @@ if ! is_up_to_date; then if ! test -d "$work_dir"; then git clone -n --shared "$cache_dir" "$work_dir" fi - commit_name=$(cache_git rev-parse "$git_rev") + commit_name=$(cache_git rev-parse --verify "$git_rev") work_git checkout "$commit_name" -- "$(readlink -f "$work_dir")" work_git checkout -q "$commit_name" work_git submodule init |