git_matches_manifest Function

public function git_matches_manifest(cached, manifest, verbosity, iunit)

Check that a cached dependency matches a manifest request

The manifest dependency only contains partial information (what’s requested), while the cached dependency always stores a commit hash because it’s built after the repo is available (saved as git_descriptor%revision==revision). So, comparing against the descriptor is not reliable

Arguments

Type IntentOptional Attributes Name
type(git_target_t), intent(in) :: cached

Two input git targets

type(git_target_t), intent(in) :: manifest

Two input git targets

integer, intent(in) :: verbosity
integer, intent(in) :: iunit

Return Value logical


Source Code

    logical function git_matches_manifest(cached,manifest,verbosity,iunit)

        !> Two input git targets
        type(git_target_t), intent(in) :: cached,manifest

        integer, intent(in) :: verbosity,iunit

        git_matches_manifest = cached%url == manifest%url
        if (.not.git_matches_manifest) then
            if (verbosity>1) write(iunit,out_fmt) "GIT URL has changed: ",cached%url," vs. ", manifest%url
            return
        endif

        !> The manifest dependency only contains partial information (what's requested),
        !> while the cached dependency always stores a commit hash because it's built
        !> after the repo is available (saved as git_descriptor%revision==revision).
        !> So, comparing against the descriptor is not reliable
        git_matches_manifest = allocated(cached%object) .eqv. allocated(manifest%object)
        if (git_matches_manifest .and. allocated(cached%object)) &
        git_matches_manifest = cached%object == manifest%object
        if (.not.git_matches_manifest) then
            if (verbosity>1) write(iunit,out_fmt) "GIT OBJECT has changed: ",cached%object," vs. ", manifest%object
        end if

    end function git_matches_manifest