Commit 7ad2458
Make "git-remote rm" delete refs acccording to fetch specs
A remote may be configured to fetch into tracking branches that
don't match its name. A user may have created a remote by hand
that will fetch to a different tracking branch namespace:
[remote "alt"]
url = git://repo.or.cz/alt-git.git
fetch = refs/heads/*:refs/remotes/origin/*
When deleting remote alt we should clean up the refs whose names
start with "refs/remotes/origin/", even though the remote itself
was named alt by the user.
To avoid deleting refs used by another remote we only clear refs
that are unique to this remote. This prevents `git prune rm alt`
from removing the refs used by say origin if alt was just using a
different URL for the same repository.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent c175a7a commit 7ad2458
1 file changed
+54
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 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 | + | |
270 | 295 | | |
271 | | - | |
| 296 | + | |
272 | 297 | | |
| 298 | + | |
273 | 299 | | |
274 | 300 | | |
275 | 301 | | |
276 | 302 | | |
277 | 303 | | |
278 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
279 | 308 | | |
280 | | - | |
281 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
282 | 321 | | |
283 | | - | |
284 | | - | |
285 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
286 | 325 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
291 | 329 | | |
292 | 330 | | |
293 | 331 | | |
| |||
313 | 351 | | |
314 | 352 | | |
315 | 353 | | |
| 354 | + | |
316 | 355 | | |
317 | | - | |
| 356 | + | |
318 | 357 | | |
319 | 358 | | |
320 | 359 | | |
| |||
324 | 363 | | |
325 | 364 | | |
326 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
327 | 369 | | |
328 | 370 | | |
329 | 371 | | |
| |||
352 | 394 | | |
353 | 395 | | |
354 | 396 | | |
355 | | - | |
356 | | - | |
357 | | - | |
| 397 | + | |
358 | 398 | | |
359 | 399 | | |
360 | 400 | | |
| |||
0 commit comments