Commit 6589541
committed
repository: retrieve worktree HEAD via refdb
The function `git_repository_head_for_worktree` currently uses
`git_reference__read_head` to directly read a given worktree's HEAD from
the filesystem. This is broken in case the repository uses a different
refdb implementation than the filesystem-based one, so let's instead
open the worktree as a real repository and use `git_reference_lookup`.
This also fixes the case where the worktree's HEAD is not a symref, but
a detached HEAD, which would have resulted in an error previously.1 parent d1f210f commit 6589541
2 files changed
+17
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2177 | 2177 | | |
2178 | 2178 | | |
2179 | 2179 | | |
2180 | | - | |
2181 | | - | |
2182 | | - | |
2183 | | - | |
2184 | | - | |
2185 | | - | |
2186 | 2180 | | |
2187 | 2181 | | |
2188 | 2182 | | |
| |||
2223 | 2217 | | |
2224 | 2218 | | |
2225 | 2219 | | |
2226 | | - | |
| 2220 | + | |
| 2221 | + | |
2227 | 2222 | | |
2228 | 2223 | | |
2229 | 2224 | | |
2230 | 2225 | | |
2231 | 2226 | | |
2232 | 2227 | | |
2233 | 2228 | | |
2234 | | - | |
2235 | | - | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
2236 | 2232 | | |
2237 | 2233 | | |
2238 | 2234 | | |
2239 | | - | |
2240 | | - | |
2241 | | - | |
2242 | | - | |
2243 | | - | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
2244 | 2240 | | |
2245 | 2241 | | |
2246 | | - | |
2247 | | - | |
2248 | 2242 | | |
2249 | | - | |
2250 | | - | |
2251 | | - | |
2252 | | - | |
2253 | | - | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
2254 | 2246 | | |
2255 | 2247 | | |
2256 | 2248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
0 commit comments