Commit b8fee3a
git-svn: fix ls-tree usage with dash-prefixed paths
To find the blob object name given a tree and pathname, we were
incorrectly calling "git ls-tree" with a "--" argument followed
by the pathname of the file we wanted to get.
git ls-tree <TREE> -- --dashed/path/name.c
Unlike many command-line interfaces, the "--" alone does not
symbolize the end of non-option arguments on the command-line.
ls-tree interprets the "--" as a prefix to match against, thus
the entire contents of the --dashed/* hierarchy would be
returned because the "--" matches "--dashed" and every path
under it.
Thanks to Anton Gyllenberg for pointing me toward the
Twisted repository as a real-world example of this case.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 9d51564 commit b8fee3a
1 file changed
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3384 | 3384 | | |
3385 | 3385 | | |
3386 | 3386 | | |
3387 | | - | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
3388 | 3390 | | |
3389 | 3391 | | |
3390 | | - | |
| 3392 | + | |
3391 | 3393 | | |
3392 | 3394 | | |
3393 | 3395 | | |
3394 | | - | |
3395 | | - | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
3396 | 3399 | | |
3397 | 3400 | | |
3398 | 3401 | | |
| |||
3411 | 3414 | | |
3412 | 3415 | | |
3413 | 3416 | | |
3414 | | - | |
3415 | | - | |
| 3417 | + | |
| 3418 | + | |
3416 | 3419 | | |
3417 | 3420 | | |
3418 | 3421 | | |
| |||
0 commit comments