-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'nd/dwim-wildcards-as-pathspecs'
"git show 'HEAD:Foo[BAR]Baz'" did not interpret the argument as a rev, i.e. the object named by the the pathname with wildcard characters in a tree object. * nd/dwim-wildcards-as-pathspecs: get_sha1: don't die() on bogus search strings check_filename: tighten dwim-wildcard ambiguity checkout: reorder check_filename conditional
- Loading branch information
Showing
5 changed files
with
54 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/sh | ||
|
||
test_description='test dwim of revs versus pathspecs in revision parser' | ||
. ./test-lib.sh | ||
|
||
test_expect_success 'setup' ' | ||
test_commit base && | ||
echo content >"br[ack]ets" && | ||
git add . && | ||
test_tick && | ||
git commit -m brackets | ||
' | ||
|
||
test_expect_success 'non-rev wildcard dwims to pathspec' ' | ||
git log -- "*.t" >expect && | ||
git log "*.t" >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'tree:path with metacharacters dwims to rev' ' | ||
git show "HEAD:br[ack]ets" -- >expect && | ||
git show "HEAD:br[ack]ets" >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success '^{foo} with metacharacters dwims to rev' ' | ||
git log "HEAD^{/b.*}" -- >expect && | ||
git log "HEAD^{/b.*}" >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success '@{foo} with metacharacters dwims to rev' ' | ||
git log "HEAD@{now [or thereabouts]}" -- >expect && | ||
git log "HEAD@{now [or thereabouts]}" >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success ':/*.t from a subdir dwims to a pathspec' ' | ||
mkdir subdir && | ||
( | ||
cd subdir && | ||
git log -- ":/*.t" >expect && | ||
git log ":/*.t" >actual && | ||
test_cmp expect actual | ||
) | ||
' | ||
|
||
test_done |