-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from CliffHoogervorst/patch-1
Fix limiting output to 1 commit
- Loading branch information
Showing
3 changed files
with
62 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,34 @@ make_commit_to_file_on_branch() { | |
git -C $repo rev-parse HEAD | ||
} | ||
|
||
make_commit_to_file_on_branch_with_path() { | ||
local repo=$1 | ||
local path=$2 | ||
local file=$3 | ||
local branch=$4 | ||
local msg=${5-} | ||
|
||
# ensure branch exists | ||
if ! git -C $repo rev-parse --verify $branch >/dev/null; then | ||
git -C $repo branch $branch master | ||
fi | ||
|
||
# switch to branch | ||
git -C $repo checkout -q $branch | ||
|
||
# modify file and commit | ||
mkdir -p $repo/$path | ||
echo x >> $repo/$path/$file | ||
git -C $repo add $path/$file | ||
git -C $repo \ | ||
-c user.name='test' \ | ||
-c user.email='[email protected]' \ | ||
commit -q -m "commit $(wc -l $repo/$path/$file) $msg" | ||
|
||
# output resulting sha | ||
git -C $repo rev-parse HEAD | ||
} | ||
|
||
make_commit_to_file() { | ||
make_commit_to_file_on_branch $1 $2 master "${3-}" | ||
} | ||
|
@@ -352,6 +380,22 @@ check_uri_from_paths() { | |
}" | ${resource_dir}/check | tee /dev/stderr | ||
} | ||
|
||
check_uri_from_paths_with_branch() { | ||
local uri=$1 | ||
local branch=$2 | ||
|
||
shift 2 | ||
|
||
jq -n "{ | ||
source: { | ||
uri: $(echo $uri | jq -R .), | ||
paths: $(echo "$@" | jq -R '. | split(" ")'), | ||
branch: $(echo $branch | jq -R .), | ||
disable_ci_skip: true | ||
}, | ||
}" | ${resource_dir}/check | tee /dev/stderr | ||
} | ||
|
||
check_uri_from_paths_ignoring() { | ||
local uri=$1 | ||
local ref=$2 | ||
|