Fix variable unbound error while REPOREF="*"
If REPOREF="*", HAS_REF will be used without initialization. As -u is set the script will terminate with error. Change-Id: Ic1d88415adfef66dfc6c1d92610a45a9eb6359f3 Signed-off-by: Liu Qing <liuqing@chinac.com>
This commit is contained in:
parent
1e9cf3a1c8
commit
d3255835d1
@ -121,7 +121,7 @@ function get_repos_for_element(){
|
|||||||
if [ "$REPOREF" != "*" ] ; then
|
if [ "$REPOREF" != "*" ] ; then
|
||||||
HAS_REF=$(git --git-dir=$CACHE_PATH/.git name-rev $REPOREF 2>/dev/null || true)
|
HAS_REF=$(git --git-dir=$CACHE_PATH/.git name-rev $REPOREF 2>/dev/null || true)
|
||||||
fi
|
fi
|
||||||
if [ -z "$DIB_OFFLINE" -o -z "$HAS_REF" ] ; then
|
if [ -z "$DIB_OFFLINE" -o -z "${HAS_REF:-}" ] ; then
|
||||||
echo "Updating cache of $REPOLOCATION in $CACHE_PATH with ref $REPOREF"
|
echo "Updating cache of $REPOLOCATION in $CACHE_PATH with ref $REPOREF"
|
||||||
# Copy named refs (which might be outside the usual heads
|
# Copy named refs (which might be outside the usual heads
|
||||||
# pattern) - e.g. gerrit
|
# pattern) - e.g. gerrit
|
||||||
|
Loading…
Reference in New Issue
Block a user