diff options
-rw-r--r-- | fpm/src/fpm/git.f90 | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fpm/src/fpm/git.f90 b/fpm/src/fpm/git.f90 index f02d06f..187b551 100644 --- a/fpm/src/fpm/git.f90 +++ b/fpm/src/fpm/git.f90 @@ -138,10 +138,19 @@ contains !> Error type(error_t), allocatable, intent(out) :: error + + !> git object ref + character(:), allocatable :: object !> Stat for execute_command_line integer :: stat + if (allocated(self%object)) then + object = self%object + else + object = 'HEAD' + end if + call execute_command_line("git init "//local_path, exitstat=stat) if (stat /= 0) then @@ -150,7 +159,7 @@ contains end if call execute_command_line("git -C "//local_path//" fetch "//self%url//& - " "//self%object, exitstat=stat) + " "//object, exitstat=stat) if (stat /= 0) then call fatal_error(error,'Error while fetching git repository for remote dependency') |