Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add *.csproj support to examples/gitserver/hooks/detect-language #12031

Merged
merged 1 commit into from
Nov 28, 2016

Conversation

jim-minter
Copy link
Contributor

@bparees, I accidentally missed this off #11896.

@@ -14,6 +14,11 @@ set -o pipefail
function has {
[[ -n $(git ls-tree --full-name --name-only HEAD ${@:1}) ]]
}
function hasglob {
git ls-tree --full-name --name-only HEAD | while read NAME; do
[[ "$NAME" == $1 ]] && return 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this going to compare "*.csproj" with "somefile.csproj" and fail? or is there some bash behavior here i'm not aware of?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latter, I believe. See bash(1) under [[ expression ]]: When the == and != operators are used, the string to the right of the operator is considered a pattern and matched according to the rules described below under Pattern Matching, as if the extglob shell option were enabled.

$ mkdir /tmp/empty && cd /tmp/empty
$ >bar.csproj
$ [[ "foo.csproj" == *.csproj ]] && echo yes
yes
$ [[ *.csproj == "foo.csproj" ]] && echo yes
$ [[ "foo.csproj" == "*.csproj" ]] && echo yes
$ [ "foo.csproj" == *.csproj ] && echo yes
$



Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i tested w/o the [[ ]] which is why it didn't work for me. looks good, thanks.

@bparees
Copy link
Contributor

bparees commented Nov 28, 2016

[merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to f715aa9

@openshift-bot
Copy link
Contributor

openshift-bot commented Nov 28, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11711/) (Base Commit: 823513c) (Image: devenv-rhel7_5424)

@openshift-bot openshift-bot merged commit 0836881 into openshift:master Nov 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants