-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added decoding for special characters in git branch names (#496)
* added decoding for special characters in git branch names Signed-off-by: MathiasAugstein <[email protected]> * added test cases for special character decoding Signed-off-by: MathiasAugstein <[email protected]> * Added information to Readme Signed-off-by: MathiasAugstein <[email protected]> --------- Signed-off-by: MathiasAugstein <[email protected]>
- Loading branch information
1 parent
12384ee
commit 1328004
Showing
3 changed files
with
15 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,8 @@ git_resource(resource_name, path_or_repo, dockerfile='Dockerfile', namespace='de | |
|
||
* `resource_name` ( str ) – the name to use for this resource | ||
* `path_or_repo` ( str ) – either the URL to the remote git repo, or the path to your local checkout. | ||
If passing a repo url, a branch may be specified with a hash delimiter (i.e. `[email protected]/path/to/repo.git#myBranchNameHere`). | ||
If passing a repo url, a branch may be specified with a hash delimiter (i.e. `[email protected]/path/to/repo.git#myBranchNameHere`). | ||
In case the branch name contains a `#` or a `@` you can escape them with the according URL encodings `%23` and `%40`, respectively. | ||
To use a tag, prefix the tag name with `tags/` (i.e. `[email protected]/path/to/repo.git#tags/v1.0.01`) | ||
To use a specific revision/sha, prefix the sha with `@` (i.e. `[email protected]/path/to/repo.git@myRevisionSha`). | ||
If no branch or revision is specified, defaults to `master` | ||
|
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 |
---|---|---|
|
@@ -27,6 +27,10 @@ url_test_cases = [ | |
url="[email protected]/path/to/repo.git", | ||
repo="repo", | ||
tree="#myBranchNameHere"), | ||
_case(input='[email protected]/path/to/repo.git#myBranch%23Name%40Here', | ||
url="[email protected]/path/to/repo.git", | ||
repo="repo", | ||
tree="#myBranch#Name@Here"), | ||
_case(input='https://[email protected]/path/repo.git', | ||
url='https://[email protected]/path/repo.git', | ||
repo='repo', | ||
|
@@ -39,6 +43,10 @@ url_test_cases = [ | |
url='https://[email protected]/path/repo.git', | ||
repo='repo', | ||
tree='@myRevisionSha'), | ||
_case(input='https://[email protected]/path/repo.git@my%23Revision%40Sha', | ||
url='https://[email protected]/path/repo.git', | ||
repo='repo', | ||
tree='@my#Revision@Sha'), | ||
] | ||
|
||
if os.name == 'nt': | ||
|