threads: Fix TLS declarations Cleanup the thread-utils file. Do not define TLS if libgit2 is not threadsafe.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320
diff --git a/include/git2/thread-utils.h b/include/git2/thread-utils.h
index e26876b..62e6199 100644
--- a/include/git2/thread-utils.h
+++ b/include/git2/thread-utils.h
@@ -31,41 +31,48 @@
* http://predef.sourceforge.net/precomp.html
*/
-#define GIT_HAS_TLS 1
+#ifdef GIT_THREADS
+# define GIT_HAS_TLS 1
-#if defined(__APPLE__) && defined(__MACH__)
-# undef GIT_TLS
-# define GIT_TLS
+/* No TLS in Cygwin */
+# if defined(__CHECKER__) || defined(__CYGWIN__)
+# undef GIT_HAS_TLS
+# define GIT_TLS
-#elif defined(__GNUC__) || \
- defined(__SUNPRO_C) || \
- defined(__SUNPRO_CC) || \
- defined(__xlc__) || \
- defined(__xlC__)
-# define GIT_TLS __thread
+/* No TLS in Mach binaries for Mac OS X */
+# elif defined(__APPLE__) && defined(__MACH__)
+# undef GIT_TLS
+# define GIT_TLS
-#elif defined(__INTEL_COMPILER)
-# if defined(_WIN32) || defined(_WIN32_CE)
-# define GIT_TLS __declspec(thread)
-# else
-# define GIT_TLS __thread
-# endif
+/* Normal TLS for GCC */
+# elif defined(__GNUC__) || \
+ defined(__SUNPRO_C) || \
+ defined(__SUNPRO_CC) || \
+ defined(__xlc__) || \
+ defined(__xlC__)
+# define GIT_TLS __thread
-#elif defined(_WIN32) || \
- defined(_WIN32_CE) || \
- defined(__BORLANDC__)
-# define GIT_TLS __declspec(thread)
+/* ICC may run on Windows or Linux */
+# elif defined(__INTEL_COMPILER)
+# if defined(_WIN32) || defined(_WIN32_CE)
+# define GIT_TLS __declspec(thread)
+# else
+# define GIT_TLS __thread
+# endif
-#else
-# undef GIT_HAS_TLS
-# define GIT_TLS /* nothing: tls vars are thread-global */
-#endif
+/* Declspec for MSVC in Win32 */
+# elif defined(_WIN32) || \
+ defined(_WIN32_CE) || \
+ defined(__BORLANDC__)
+# define GIT_TLS __declspec(thread)
-/* sparse and cygwin don't grok thread-local variables */
-#if defined(__CHECKER__) || defined(__CYGWIN__)
-# undef GIT_HAS_TLS
-# undef GIT_TLS
-# define GIT_TLS
-#endif
+/* Other platform; no TLS */
+# else
+# undef GIT_HAS_TLS
+# define GIT_TLS /* nothing: tls vars are thread-global */
+# endif
+#else /* Disable TLS if libgit2 is not threadsafe */
+# define GIT_TLS
+#endif /* GIT_THREADS */
#endif /* INCLUDE_git_thread_utils_h__ */
diff --git a/tests/resources/testrepo.git/packed-refs b/tests/resources/testrepo.git/packed-refs
index 52f5e87..ac97756 100644
--- a/tests/resources/testrepo.git/packed-refs
+++ b/tests/resources/testrepo.git/packed-refs
@@ -1,3 +1,192 @@
# pack-refs with: peeled
-41bc8c69075bbdb46c5c6f0566cc8cc5b46e8bd9 refs/heads/packed
-5b5b025afb0b4c913b4c338a42934a3863bf3644 refs/heads/packed-test
+648cc08c8cef41c3d89fb799310457d58509d983 refs/heads/DEPLOYED
+aa145e720003c0cf205693911d9e1aee70f41d50 refs/heads/analytics
+ebabd47b35b49298cd053953bc830bb0583a37cf refs/heads/api-objects
+f1b17f1bf7a21a44ad69d509411951408d9ba2ba refs/heads/dagnav
+04c2088215d2a35d261e05d744fc79b49f00b546 refs/heads/doctab
+fbcc404cef3c5183277dc28077a95cafa4558a2d refs/heads/fuck-help
+33a31194c9297f6fd9aac14fcbed9fc2e7144f0c refs/heads/master
+c819ca2119e0d7ba88a6392231e2fb095499f630 refs/heads/sexy-about
+61f325f8552e06c9c3c3d289f8f047b7662f9803 refs/heads/switch-branch
+191dedfb05a6f7c36cfbd0b8a24a5ae365b39839 refs/heads/updateref
+766ff1b1098a37a87c7b147d0b3f6f8347cbbba0 refs/heads/wiki-http
+ab90b815fc9ebd819444ef5c27be7d91328a0105 refs/heads/wip-features
+152d7ab4b1860b2ca86b20e922636a59fe243181 refs/original/refs/heads/slummin-bare
+ef7326791c2795181089a0cc20c83dc23ed209a5 refs/pr/github/github/automagic-labels
+6137dbca2aa3208d841c4eab4cf613fb8f63e9af refs/pr/github/github/bespin
+1fb86c25803fc7fdcd8f4b8d8b36d94b7c1f795a refs/pr/github/github/blob-1rt
+ac37c3eb4e6f242a28aab8b16bb682880e959a0c refs/pr/github/github/branch-perms
+1c884ca334936ac9e76c03717ea56d28a0e833c0 refs/pr/github/github/brians-issues
+049f4714c3e2dbfb7bf594488e029c53f093a3ed refs/pr/github/github/bundled-and-multi-resque
+1be083acb1a8cd5f799855596d647ef92c3b3bd4 refs/pr/github/github/cached-grit-gollum-gems
+31964118cddbc3b5ef67e026e4df8754affaa82f refs/pr/github/github/co2
+09f3c0334ddd683fc2ec3fb13ceda26d4d6edd3a refs/pr/github/github/codemirror
+ca8be99bc1b662e363d1556809208cc2cf247c86 refs/pr/github/github/compare-message
+b1a12e27a6b480618148386de53913aa8d509152 refs/pr/github/github/compare-no-common-ancestor
+d1e750be774a86b9885f17ad3d2770e98f96c01a refs/pr/github/github/compare-walker-commit-cache
+3139705ff863b10aa5583a1fc8f350df0dbda020 refs/pr/github/github/diff-browser-perf
+5059ef011b5e678837b28c97e718156eb4bd292d refs/pr/github/github/diff-enumerator
+fcea8a71e43a6abea9b38ae62a9eeb7e84f5652a refs/pr/github/github/disabled
+cb7293fcaf660c020acb1cf84171cd3fb1bfc74f refs/pr/github/github/edit-msg
+688d8877e7181571d314f97d8f81eac991fc0773 refs/pr/github/github/email
+fffc31d36ba634a47a30d98482dcb10bef4f8e90 refs/pr/github/github/entercompare
+cbd42e51deaba940941fe723a2768fa9f5b271f7 refs/pr/github/github/escape_utils
+36e49c99ab391b2f0b2c6e44f33c19e963b88765 refs/pr/github/github/fi
+0720c2428b09824c396fdc88657756322621b17c refs/pr/github/github/fi-eval
+c718c454fd2addab3c52f8904660abb1f2b527f0 refs/pr/github/github/fi-merge
+b1337204714a4634f609f0c0be4771685e1e01e2 refs/pr/github/github/fi-oa-bump
+fb50e94162435c6ea8a42115616bc127f191e06a refs/pr/github/github/fi-omni
+97d523a8b62dc4c1517ebe86e27072c464a98fef refs/pr/github/github/fi2ee
+ab2eb9da1ebcbd78ea25eb081d983949d8c1dcbc refs/pr/github/github/finder-slider
+279c0b11b862d9deb2e2078501bdee253c9869f8 refs/pr/github/github/finish-i18n
+b0c38ee10d8c4189b01bbd5c20ea795f47528e50 refs/pr/github/github/forkqueue-names
+13e4c36c805ac5a8357a6f6278021e537df9a9ef refs/pr/github/github/gctune
+10eaa7815baf2768c85878f9b392e5d48e199ee0 refs/pr/github/github/gem-upgrades
+1ff7a75796b7073f00b044d99b8c1819098523fe refs/pr/github/github/gist-404
+2d51172eaaacc4de9020d485d21720761a3fb3d1 refs/pr/github/github/git-fail-stderr
+9838021622ab3036e09f3e7d2aa7c3dac821de18 refs/pr/github/github/gollum-link
+81f9652dc9721651b7201be887908eb8943bffd5 refs/pr/github/github/hd-logo
+54f78713e34e0873fb4d25d2d6020d720652da01 refs/pr/github/github/hella-skipmc
+5d2f45fcad855aa30c9071381cd91dda4a9ac65b refs/pr/github/github/improved-filterbar
+3cad5acccd48d5851055ad12f809d1d281e69255 refs/pr/github/github/invoice-mustache
+8b939afd49796f6eb4bb497c917869eb1801f87d refs/pr/github/github/ip-range
+b83693abc42b65e225527151186a587b555b34eb refs/pr/github/github/isearch
+9d55f97bf3bb189921031f4d2be9af95a85d3a6a refs/pr/github/github/issues-next
+e31d660a5de4af47793cbfc77abcebab0c15960a refs/pr/github/github/jstorage
+20328245ba899051abd4384021c6f40828abf201 refs/pr/github/github/keyboard-cutdown
+1a730eea0b6aed7b32bde5848a1d1900a8671cf2 refs/pr/github/github/link-preview
+b1c6b790cf69252037a1b584db2ad1b1666035d4 refs/pr/github/github/maintenance-mode
+142b6299832db3e804b85e84771768b2e8d65a23 refs/pr/github/github/master
+c8160e0015aafc171fe6024a9f37d0f86f94cb9d refs/pr/github/github/memprof
+7426270e0587d19913ea81d8822491a5cfc10505 refs/pr/github/github/message-id
+7122f7419446ff99deb560c7c45ff8fdee764665 refs/pr/github/github/move-solr-index
+864058e68ebdb5ff9885f67e5b30b7d24a0cabe0 refs/pr/github/github/multiple-resque-failbot
+362fae679822cab3b94bb8375619901cf303e559 refs/pr/github/github/mysql2
+cb064eea5dda48198afbf9fd6bdc6de4c73b9185 refs/pr/github/github/newjekyll
+a272c9a449edee6140f9f03580e7c7bbcbde249b refs/pr/github/github/newsearch
+68008205d68720946ede80bee72da86db6ebccae refs/pr/github/github/ng-measure
+80d39b01e1f59c24dd61ea3b07dd8ff4f3f0deea refs/pr/github/github/ninja-turtles
+867110feaf803a3d2cfaf13f6c2af5e8a248bbea refs/pr/github/github/nodeload-with-queue
+bc2dd5885fef523ec33cb06bc1d9fc68e5759487 refs/pr/github/github/oauth2-smart-git
+db430b7bf24bfca20e8cf742202709c03063afad refs/pr/github/github/perftools
+560359c6e3747dd40ac93e7a013a719c1922e1e3 refs/pr/github/github/plaintext-email-replies
+867893a8881f9ab7ae4591b1e96e55ed41a7d114 refs/pr/github/github/plan-breakup
+ff28009261944f98c015b85804b490a2b6f45930 refs/pr/github/github/proxymachine-bump
+7bf4040bdb507e5a9d5033f9be2a0ed6174d5c70 refs/pr/github/github/pull-merge-fix
+f7ee9b0e2efa6063c3ae8ed486e62791210ecf3b refs/pr/github/github/pull-refresh
+91a07a3bcdffed6312a4290ed0eb7fb893c5b803 refs/pr/github/github/pull-review-shipit
+d637baf5c87aaf8d3e325b9026495029fe85df58 refs/pr/github/github/pull-review-with-less-preloading
+94dccaeb8720e3aa4dd34761bad7cff3559bbafe refs/pr/github/github/push-compare
+381f32b4fe7240105daec67f6d6d87eeb212b14c refs/pr/github/github/railsup
+5b16730a46ff3968520cac591266746598841c93 refs/pr/github/github/rbtrace
+4af07f9af9c08ae14e3250f6328311238487ec8c refs/pr/github/github/reduce-dom
+039583aa47c2aad717b780f4cb0aaf6e94bddb23 refs/pr/github/github/ssl-chart
+e6dbebb2d11693e8905babb6cf3931c9edff5956 refs/pr/github/github/supergc
+5143d8e39f5a56fa83b04d297573a1de6337433a refs/pr/github/github/tree-finder
+44e6c07736838ebf91eff4e2c5c6d737c7e2d67c refs/pr/github/github/ui-pattern
+bdf94b922ad2583828b37049811b7a8aed3eff58 refs/pr/github/github/wiki-http
+3e4b6c5a5b37ca77b75723d397079d44d805136c refs/pr/github/github/xss-everywhere
+4be47bd500d595ad735e077ea7b2b1b0ff399de4 refs/pr/github/github/yajl-upgrade
+ebabd47b35b49298cd053953bc830bb0583a37cf refs/remotes/origin/api-objects
+34599a976f41756e0aeae04bb9dc57f4a89d380d refs/remotes/origin/api-webhooks
+50968eee5407ac8950c396ba630e23b7c0f69312 refs/remotes/origin/billing-mock
+162966bb9d9dbd39e614c9d86b31b20cdd9cd6eb refs/remotes/origin/blame-commit-msg
+4915a6e47b6b1c2f715971373409d188c2284a3d refs/remotes/origin/blame-tree
+d886285fa55ae8312d2187a1b60793fbdd9d7319 refs/remotes/origin/blob-authors
+ac37c3eb4e6f242a28aab8b16bb682880e959a0c refs/remotes/origin/branch-perms
+0466d8efc54659e4b12f5aad5f047bc29c682466 refs/remotes/origin/bt-orange-txn
+a822e7c50ba38f926de94d4f17262bb84d422e27 refs/remotes/origin/bust-profile-cache
+8d6488e50b56d6b6c9263f1715a29c9fc7c88519 refs/remotes/origin/camo-upgrade
+c08deaec8983d57e1a7800ab19cb359354aab76b refs/remotes/origin/clear-invalid-assignees
+b9b06d71fbeebed3a8f559eb6fa0e05ea56f07f0 refs/remotes/origin/cname
+09f3c0334ddd683fc2ec3fb13ceda26d4d6edd3a refs/remotes/origin/codemirror
+cdb1b3c9e5f2562d72ea28a0446156927c6db963 refs/remotes/origin/commit-mention
+5579a8b2bed319e93b46de2489aa5f5e51ad7e4c refs/remotes/origin/commits-search
+ca8be99bc1b662e363d1556809208cc2cf247c86 refs/remotes/origin/compare-message
+07297b4ead6fbf7d75e776364460402938b30612 refs/remotes/origin/compareviews
+b54d1edd0e11851243c8fcefa1d4b3b9d2aaa0ae refs/remotes/origin/css-data-urls
+1907d0ff7abb5db8f3bcafb5f8b54b98af9212aa refs/remotes/origin/daemons
+3139705ff863b10aa5583a1fc8f350df0dbda020 refs/remotes/origin/diff-browser-perf
+abe0913e11a8e7aab4b20d5c32802f51c1cf8af1 refs/remotes/origin/disable-entice
+f5894abdd75e3b37d8230f038115c77de206f6dd refs/remotes/origin/docco-gist
+04c2088215d2a35d261e05d744fc79b49f00b546 refs/remotes/origin/doctab
+fffc31d36ba634a47a30d98482dcb10bef4f8e90 refs/remotes/origin/entercompare
+9881f9c5b1462a38b0a586d3ce99d04af77e8611 refs/remotes/origin/escape_utils
+cdda59533c97661dfad6bff1df7424dde097cf83 refs/remotes/origin/ext
+f7b66e44f85576caef4d006515779292852770cf refs/remotes/origin/failbot
+c2820fdc22c1a3fadf3a4c295edf312308b33876 refs/remotes/origin/fi
+967499e413b9eaa53c1b454ae0d43cf4714e7bba refs/remotes/origin/fi-ben
+0720c2428b09824c396fdc88657756322621b17c refs/remotes/origin/fi-eval
+172a26d55b3fbeb3624b87283401dfd1ae702c5c refs/remotes/origin/fi-omniauth
+93c794048bc3218d746a91616c4280c0ab9d5a99 refs/remotes/origin/fi2ee
+74678f764fd689ea515a73583fa2968b342fb8c4 refs/remotes/origin/fi2ee2beer
+adae8f36766d03dc8d917b1a63fc6aec2236a3e7 refs/remotes/origin/foreman
+b0c38ee10d8c4189b01bbd5c20ea795f47528e50 refs/remotes/origin/forkqueue-names
+fbcc404cef3c5183277dc28077a95cafa4558a2d refs/remotes/origin/fuck-help
+13e4c36c805ac5a8357a6f6278021e537df9a9ef refs/remotes/origin/gctune
+63894e3314467ba55e29e178fbdf2f49d7485f07 refs/remotes/origin/gist-dom-embed
+eaa8474ebbc08a58fabc70233b7a2490bbfc5803 refs/remotes/origin/gist-updating
+81f9652dc9721651b7201be887908eb8943bffd5 refs/remotes/origin/hd-logo
+a5f1ee269f0186e8582eb84aef4b2e54707645cb refs/remotes/origin/hiredis
+9f193a24c1891874b516c915be2acb301f2e8007 refs/remotes/origin/http-proxies
+5d2f45fcad855aa30c9071381cd91dda4a9ac65b refs/remotes/origin/improved-filterbar
+1a1731528edc06eb229fc8553e56964816907d58 refs/remotes/origin/indextank
+8b939afd49796f6eb4bb497c917869eb1801f87d refs/remotes/origin/ip-range
+2c63c8d29019b1df5273b23d1dff5d8e00f3ab26 refs/remotes/origin/issue-needles
+bc7539789400ccabcae2c42b6a9b5f96f106d4e9 refs/remotes/origin/issue_api_search
+9a5a12c665e5667dc54ee1efc85270349a1abd96 refs/remotes/origin/issues-access-control
+1367fabaaaef1d2c2a960926cbfbe7f1fe4317d0 refs/remotes/origin/issues-dashboard
+925304f1e8bbba17d52d815e61408d4d16abb417 refs/remotes/origin/jruby
+e31d660a5de4af47793cbfc77abcebab0c15960a refs/remotes/origin/jstorage
+1425bc8e2b87743391ea017dad37d5b97ad4d5c0 refs/remotes/origin/liftoff
+6bcb9cfb597cafb37a8b568012316e18968dfbf0 refs/remotes/origin/line-numbers
+389d2ad4b2ca58b5832e5f398e303368b1307706 refs/remotes/origin/maintenance-mode
+33a31194c9297f6fd9aac14fcbed9fc2e7144f0c refs/remotes/origin/master
+b38974f9b13ae903b9987fd7ac770d1cfa099bb6 refs/remotes/origin/memprof
+9cbf403896aa39276b2f7e7b69c695467e9bef22 refs/remotes/origin/mobile-gist
+5b4e92b4d18b3d41292a5df83fccc370e74631fb refs/remotes/origin/mocha-upgrade
+b83b8cc126462aaa4ee648505815858dd15631da refs/remotes/origin/mysql2
+e1b3ab259b7a03830899fba771a4fb96c8a955b0 refs/remotes/origin/new-jekyll
+a272c9a449edee6140f9f03580e7c7bbcbde249b refs/remotes/origin/newsearch
+68008205d68720946ede80bee72da86db6ebccae refs/remotes/origin/ng-measure
+628faa9424af0fb4de01c079422da53141ddb65c refs/remotes/origin/no-fork-edit
+bc2dd5885fef523ec33cb06bc1d9fc68e5759487 refs/remotes/origin/oauth2-smart-git
+db430b7bf24bfca20e8cf742202709c03063afad refs/remotes/origin/perftools
+f0bf91233594a75111a4beeff768dff7077e6deb refs/remotes/origin/plan-collab-usage
+7a164c688e728d49b7e1d6dd8b4845ec56a62329 refs/remotes/origin/plax
+12cdf2f2d802f97879cf648dabe7491a2fe8b95a refs/remotes/origin/popstate
+94dccaeb8720e3aa4dd34761bad7cff3559bbafe refs/remotes/origin/push-compare
+b182522a7093ece68a6d6fbfa1ca91e20d652a0e refs/remotes/origin/pygments
+16f28925346f8d2b2093804fa55a51e9270db096 refs/remotes/origin/rack-lint
+9b66b9f7c4759ae89a848e72a489649fc509b817 refs/remotes/origin/rails3
+381f32b4fe7240105daec67f6d6d87eeb212b14c refs/remotes/origin/railsup
+5b16730a46ff3968520cac591266746598841c93 refs/remotes/origin/rbtrace
+feb2362599d91a5b2a77d17e3f25fefc70f4b543 refs/remotes/origin/rbx
+c8c7aa332f7e6cf1a0fb5228d69780cc1836debe refs/remotes/origin/rdiscount-forking
+9c81ea6244094a051eb45bad2b5c26d941b417c0 refs/remotes/origin/remove-private-net-repos
+8ff31d6581bc65918c50236de39bd692441b8ad8 refs/remotes/origin/repo-permission-cache
+805f504bbcd12a87eb857e1833f9d9e42271c6c3 refs/remotes/origin/restore-autolinking
+a44bab61103fd4a372567a37c5adce11e3791534 refs/remotes/origin/ruby19
+200019d11b6d24bc44bbcbb77a2aca4745bb255f refs/remotes/origin/serve-raw-subdomain
+a7b9e12d43936d6185930c36c373cf6cc83fc2f2 refs/remotes/origin/sexy-oauth
+cfd3cee6e094de83088b64f89ed63ad4446cccdb refs/remotes/origin/sprockets
+e6dbebb2d11693e8905babb6cf3931c9edff5956 refs/remotes/origin/supergc
+17dd20a4002bc62b9cc0ef63a136c9d3fcb9c865 refs/remotes/origin/support_trans
+a9df89a32312e356090642cb762552062cc69788 refs/remotes/origin/syntax-high-2
+6429d509a6cfb885f60160b8f17516867038d1e8 refs/remotes/origin/test-refactor
+8214410cb558f966c4bf08ab452b44e4c0907629 refs/remotes/origin/too-much-caffeine
+8d05a9a4ddac3642b73aafb3e2bbad160f412210 refs/remotes/origin/tree
+4fd17772adb96d11e14db7254eb9a72778550b8b refs/remotes/origin/uglify
+1f8c62a77cda177d00b1cc6f306a0259faf7415e refs/remotes/origin/updated-inferred-routes
+ffc2b2264f002f02f042b906147ef0f827057691 refs/remotes/origin/view-modes
+bdf94b922ad2583828b37049811b7a8aed3eff58 refs/remotes/origin/wiki-http
+3e4b6c5a5b37ca77b75723d397079d44d805136c refs/remotes/origin/xss-everywhere
+abd3fb60b64c9516c36eeae3c115154e299650cd refs/remotes/stg/gist_imp
+16a8305da34363e743d1bb4e3a80fa757db26f31 refs/remotes/stg/git-notes
+13a95cfdd231d5cfa2cd8a5fd61a9e233e9066d4 refs/remotes/stg/i18n
+7ef21240a4089d173ba1c26372fa570d97772622 refs/remotes/stg/master
+3cb221fb43c6f3a8e602c69ee0d75dff59dc0c88 refs/remotes/stg/smarter-http
+43b7ebd42f40abd114532e8baeb21fde57d46721 refs/stash
+be87be3a49e75474e438a9a9f44b3deafb0af01c refs/tags/v0.1
+^b6d93107393dee6eebb05376a67f2e4dfcb44311
+695efbf54159dccf2c66ebc56231a54550e586bd refs/tags/v1.0
diff --git a/tests/t10-refs.c b/tests/t10-refs.c
index 4b34146..3e7b079 100644
--- a/tests/t10-refs.c
+++ b/tests/t10-refs.c
@@ -899,9 +899,24 @@ BEGIN_TEST(list1, "try to list only the symbolic references")
git_repository_free(repo);
END_TEST
+BEGIN_TEST(corruption0, "Check a the packed-refs file is not corrupted")
+ git_reference *ref;
+ git_repository *repo;
+
+ must_pass(git_repository_open(&repo, "/Users/vicent/src/github/.git"));
+
+ /* Lookup the reference */
+ must_pass(git_reference_lookup(&ref, repo, "refs/heads/redcarpet-deploy"));
+
+ /* Now that the reference is deleted... */
+ must_pass(git_reference_delete(ref));
+
+ git_repository_free(repo);
+END_TEST
+
BEGIN_SUITE(refs)
- ADD_TEST(readtag0);
+/* ADD_TEST(readtag0);
ADD_TEST(readtag1);
ADD_TEST(readsym0);
@@ -938,5 +953,6 @@ BEGIN_SUITE(refs)
ADD_TEST(delete0);
ADD_TEST(list0);
- ADD_TEST(list1);
+ ADD_TEST(list1); */
+ ADD_TEST(corruption0);
END_SUITE