Commit 4f82101
Eric Wong
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>1 parent b0085a7 commit 4f82101
1 file changed
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3387 | 3387 | | |
3388 | 3388 | | |
3389 | 3389 | | |
3390 | | - | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
3391 | 3393 | | |
3392 | 3394 | | |
3393 | | - | |
| 3395 | + | |
3394 | 3396 | | |
3395 | 3397 | | |
3396 | 3398 | | |
3397 | | - | |
3398 | | - | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
3399 | 3402 | | |
3400 | 3403 | | |
3401 | 3404 | | |
| |||
3414 | 3417 | | |
3415 | 3418 | | |
3416 | 3419 | | |
3417 | | - | |
3418 | | - | |
| 3420 | + | |
| 3421 | + | |
3419 | 3422 | | |
3420 | 3423 | | |
3421 | 3424 | | |
| |||
0 commit comments