# This file is part of grecs  -*- Autotest -*-
# Copyright (C) 2011-2016 Sergey Poznyakoff
#
# Grecs is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# Grecs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Grecs.  If not, see <http://www.gnu.org/licenses/>.

AT_SETUP(Locations: git)
AT_KEYWORDS([locus git locus-git])

AT_DATA([test.cf],[[[core]]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[[remote "origin"]]
        url = ssh://git.gnu.org.ua/gitroot/grecs.git
        fetch = +refs/heads/*:refs/remotes/origin/*
])

AT_CHECK([gcffmt -type=GIT -locus test.cf],
[0],
[test.cf:2.9-35: .core.repositoryformatversion: "0"
test.cf:3.9-23: .core.filemode: "true"
test.cf:4.9-20: .core.bare: "false"
test.cf:5.9-31: .core.logallrefupdates: "true"
test.cf:7.9-52: .remote.origin.url: "ssh://git.gnu.org.ua/gitroot/grecs.git"
test.cf:8.9-51: .remote.origin.fetch: "+refs/heads/*:refs/remotes/origin/*"
])

AT_CHECK([gcffmt -type=GIT -novalue -locus test.cf],
[0],
[test.cf:2.9-31: .core.repositoryformatversion
test.cf:3.9-16: .core.filemode
test.cf:4.9-12: .core.bare
test.cf:5.9-24: .core.logallrefupdates
test.cf:7.9-11: .remote.origin.url
test.cf:8.9-13: .remote.origin.fetch
])

AT_CHECK([gcffmt -type=GIT -nopath -locus test.cf],
[0],
[test.cf:2.35: "0"
test.cf:3.20-23: "true"
test.cf:4.16-20: "false"
test.cf:5.28-31: "true"
test.cf:7.15-52: "ssh://git.gnu.org.ua/gitroot/grecs.git"
test.cf:8.17-51: "+refs/heads/*:refs/remotes/origin/*"
])

AT_CLEANUP

