summaryrefslogtreecommitdiff
path: root/spec/data
diff options
context:
space:
mode:
authorSeth Falcon <seth@opscode.com>2013-01-29 22:03:49 -0800
committerBryan McLellan <btm@opscode.com>2013-05-24 07:40:04 -0700
commit8093045e9ce178bd82773ab3659787f48cfc0172 (patch)
treed9d57c916e7d1949d0e56a55d12ad74481735f9b /spec/data
parentccec71b6c500f456f90500f7948cbc2d97b0b74d (diff)
downloadchef-8093045e9ce178bd82773ab3659787f48cfc0172.tar.gz
[CHEF-2420] Support annotated tags in the git provider
Annotated tags have their own SHA and also point to a SHA in the git repo. Using git ls-remote $REPO $TAG* the tagged SHAs can be identified by the '^{}' suffix appended to the corresponding tag name. When resolving the remote reference, we now search for $TAG* and use the SHA of the tagged commit (with ^{}) if it is there and otherwise use the SHA with an exact match for $TAG (to avoid capturing anything extra via the glob used to return refs). If no revision is specified, we force 'HEAD' in the git ls-remote call to constrain what can come back from the remote. Further, we protect against a badly chosen annotated tag named 'HEAD'. The functional test suite includes a git bundle of a small example repo. We found that locally cloning this bundle provided the closest simulation of `git ls-remote` behavior. YMMV depending on git version. The test suite could be extended to improve overall coverage, but does verify the desired behavior for annotated tags.
Diffstat (limited to 'spec/data')
-rw-r--r--spec/data/git_bundles/example-repo.gitbundlebin0 -> 1214 bytes
1 files changed, 0 insertions, 0 deletions
diff --git a/spec/data/git_bundles/example-repo.gitbundle b/spec/data/git_bundles/example-repo.gitbundle
new file mode 100644
index 0000000000..de08296dc3
--- /dev/null
+++ b/spec/data/git_bundles/example-repo.gitbundle
Binary files differ