Skip to content

Commit 9b790fb

Browse files
committed
Update: use default git object = 'HEAD' for checkout
1 parent a48c13f commit 9b790fb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

fpm/src/fpm/git.f90

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,19 @@ subroutine checkout(self,local_path, error)
138138

139139
!> Error
140140
type(error_t), allocatable, intent(out) :: error
141+
142+
!> git object ref
143+
character(:), allocatable :: object
141144

142145
!> Stat for execute_command_line
143146
integer :: stat
144147

148+
if (allocated(self%object)) then
149+
object = self%object
150+
else
151+
object = 'HEAD'
152+
end if
153+
145154
call execute_command_line("git init "//local_path, exitstat=stat)
146155

147156
if (stat /= 0) then
@@ -150,7 +159,7 @@ subroutine checkout(self,local_path, error)
150159
end if
151160

152161
call execute_command_line("git -C "//local_path//" fetch "//self%url//&
153-
" "//self%object, exitstat=stat)
162+
" "//object, exitstat=stat)
154163

155164
if (stat /= 0) then
156165
call fatal_error(error,'Error while fetching git repository for remote dependency')

0 commit comments

Comments
 (0)