Improve fetch_from_repo compatibility with older git versions
This commit is contained in:
parent
a7c286ac04
commit
08d397fb0d
@ -197,9 +197,11 @@ fetch_from_repo()
|
||||
cd $SOURCES/$workdir
|
||||
|
||||
# check if existing remote URL for the repo or branch does not match current one
|
||||
if [[ $(git rev-parse --is-inside-work-tree 2>/dev/null) == true && \
|
||||
# may not be supported by older git versions
|
||||
local current_url=$(git remote get-url origin 2>/dev/null)
|
||||
if [[ -n $current_url && $(git rev-parse --is-inside-work-tree 2>/dev/null) == true && \
|
||||
$(git rev-parse --show-toplevel) == $(pwd) && \
|
||||
$(git remote get-url origin) != $url ]]; then
|
||||
$current_url != $url ]]; then
|
||||
display_alert "Remote URL does not match, removing existing local copy"
|
||||
rm -rf .git *
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user