diff options
author | Swift Geek <swiftgeek@gmail.com> | 2017-10-29 04:46:17 +0000 |
---|---|---|
committer | Gogs <gogitservice@gmail.com> | 2017-10-29 04:46:17 +0000 |
commit | 5ff0c88449bb5bf03e4e38246565d3272fca1db5 (patch) | |
tree | e86f14dfddc867e8a8abdfa31713edcc2cf87c3d /libs/git | |
parent | bedc62fdada9e0e7a67b82153b186689dda07145 (diff) | |
parent | 5c1fe562d8044249f5830df826544bc72ecb41b2 (diff) | |
download | librebootfr-5ff0c88449bb5bf03e4e38246565d3272fca1db5.tar.gz librebootfr-5ff0c88449bb5bf03e4e38246565d3272fca1db5.zip |
Merge branch 'readability-changes' of kragle/libreboot into master
Diffstat (limited to 'libs/git')
-rwxr-xr-x | libs/git | 92 |
1 files changed, 46 insertions, 46 deletions
@@ -63,7 +63,7 @@ git_branch_create() { cd "$repository_path" git checkout -B "$branch" - if ! [ -z "$revision" ] + if [[ -n "$revision" ]] then git reset --hard "$revision" fi @@ -96,13 +96,13 @@ git_branch_check() { ( cd "$repository_path" 2> /dev/null > /dev/null - if [ $? -ne 0 ] + if [[ $? -ne 0 ]] then return 1 fi git rev-parse --verify "$branch" 2> /dev/null > /dev/null - if [ $? -ne 0 ] + if [[ $? -ne 0 ]] then return 1 fi @@ -123,13 +123,13 @@ git_fetch_check() { ( cd "$repository_path" 2> /dev/null > /dev/null - if [ $? -ne 0 ] + if [[ $? -ne 0 ]] then return 1 fi - local output=$( git fetch --dry-run origin 2>&1 ) - if ! [ -z "$output" ] + local output=$(git fetch --dry-run origin 2>&1) + if [[ -n "$output" ]] then return 1 fi @@ -220,7 +220,7 @@ git_project_repository_path() { git_project_check() { local repository=$1 - local repository_path=$( git_project_repository_path "$repository" ) + local repository_path=$(git_project_repository_path "$repository") git_check "$repository_path" } @@ -257,8 +257,8 @@ git_project_clone() { shift local urls=$@ - local repository_path=$( git_project_repository_path "$repository" ) - local directory_path=$( dirname "$repository_path" ) + local repository_path=$(git_project_repository_path "$repository") + local directory_path=$(dirname "$repository_path") local url mkdir -p "$directory_path" @@ -270,7 +270,7 @@ git_project_clone() { do git_clone "$repository_path" "$url" - if [ $? -eq 0 ] + if [[ $? -eq 0 ]] then return 0 fi @@ -297,11 +297,11 @@ git_project_prepare_blobs() { local repository=$1 shift - local repository_path=$( git_project_repository_path "$repository" ) - local blobs_path=$( project_blobs_path "$project" "$@" ) + local repository_path=$(git_project_repository_path "$repository") + local blobs_path=$(project_blobs_path "$project" "$@") local blob - if ! [ -f "$blobs_path" ] + if ! [[ -f "$blobs_path" ]] then return fi @@ -320,7 +320,7 @@ git_project_prepare_patch() { local repository=$1 shift - local project_path=$( project_path "$project" ) + local project_path=$(project_path "$project") local configs_path="$project_path/$CONFIGS" local prepare_branch local prepare_path @@ -330,9 +330,9 @@ git_project_prepare_patch() { for argument in "" "$@" do - if ! [ -z "$argument" ] + if [[ -n "$argument" ]] then - if [ -z "$path" ] + if [[ -z "$path" ]] then path="$argument" else @@ -344,7 +344,7 @@ git_project_prepare_patch() { local revision_path="$configs_path/$path/$REVISION" - if ! [ -f "$revision_path" ] + if ! [[ -f "$revision_path" ]] then continue fi @@ -353,7 +353,7 @@ git_project_prepare_patch() { prepare_path=$path done - if ! [ -z "$prepare_branch" ] + if [[ -n "$prepare_branch" ]] then git_project_patch_recursive "$project" "$repository" "$prepare_branch" "$prepare_path" fi @@ -365,8 +365,8 @@ git_project_prepare_revision() { local repository=$1 shift - local repository_path=$( git_project_repository_path "$repository" ) - local project_path=$( project_path "$project" ) + local repository_path=$(git_project_repository_path "$repository") + local project_path=$(project_path "$project") local configs_path="$project_path/$CONFIGS" local prepare_branch local prepare_revision @@ -376,9 +376,9 @@ git_project_prepare_revision() { for argument in "" "$@" do - if ! [ -z "$argument" ] + if [[ -n "$argument" ]] then - if [ -z "$path" ] + if [[ -z "$path" ]] then path="$argument" else @@ -390,16 +390,16 @@ git_project_prepare_revision() { local revision_path="$configs_path/$path/$REVISION" - if ! [ -f "$revision_path" ] + if ! [[ -f "$revision_path" ]] then continue fi prepare_branch=$branch - prepare_revision=$( cat "$revision_path" ) + prepare_revision=$(cat "$revision_path") done - if ! [ -z "$prepare_branch" ] + if [[ -n "$prepare_branch" ]] then git_branch_create "$repository_path" "$prepare_branch" "$prepare_revision" fi @@ -411,8 +411,8 @@ git_project_prepare_check() { local repository=$1 shift - local repository_path=$( git_project_repository_path "$repository" ) - local project_path=$( project_path "$project" ) + local repository_path=$(git_project_repository_path "$repository") + local project_path=$(project_path "$project") local configs_path="$project_path/$CONFIGS" local prepare_branch local branch=$project @@ -421,9 +421,9 @@ git_project_prepare_check() { for argument in "" "$@" do - if ! [ -z "$argument" ] + if [[ -n "$argument" ]] then - if [ -z "$path" ] + if [[ -z "$path" ]] then path="$argument" else @@ -435,7 +435,7 @@ git_project_prepare_check() { local revision_path="$configs_path/$path/$REVISION" - if ! [ -f "$revision_path" ] + if ! [[ -f "$revision_path" ]] then continue fi @@ -443,7 +443,7 @@ git_project_prepare_check() { prepare_branch=$branch done - if ! [ -z "$prepare_branch" ] + if [[ -n "$prepare_branch" ]] then git_branch_check "$repository_path" "$prepare_branch" fi @@ -455,14 +455,14 @@ git_project_prepare_clean() { local repository=$1 shift - local repository_path=$( git_project_repository_path "$repository" ) + local repository_path=$(git_project_repository_path "$repository") local prepare_branch local branch=$project local argument for argument in "" "$@" do - if ! [ -z "$argument" ] + if [[ -n "$argument" ]] then branch="$branch-$argument" fi @@ -475,7 +475,7 @@ git_project_prepare_clean() { prepare_branch=$branch done - if ! [ -z "$prepare_branch" ] + if [[ -n "$prepare_branch" ]] then # Let's not worry about missing branches. ( @@ -483,7 +483,7 @@ git_project_prepare_clean() { git_branch_delete "$repository_path" "$prepare_branch" - if [ $? -ne 0 ] + if [[ $? -ne 0 ]] then return 0 fi @@ -497,14 +497,14 @@ git_project_checkout() { local repository=$1 shift - local repository_path=$( git_project_repository_path "$repository" ) + local repository_path=$(git_project_repository_path "$repository") local checkout_branch local branch=$project local argument for argument in "" "$@" do - if ! [ -z "$argument" ] + if [[ -n "$argument" ]] then branch="$branch-$argument" fi @@ -517,7 +517,7 @@ git_project_checkout() { checkout_branch=$branch done - if ! [ -z "$checkout_branch" ] + if [[ -n "$checkout_branch" ]] then git_branch_checkout "$repository_path" "$checkout_branch" git_submodule_update "$repository_path" @@ -530,7 +530,7 @@ git_project_update() { local repository=$1 shift - local repository_path=$( git_project_repository_path "$repository" ) + local repository_path=$(git_project_repository_path "$repository") git_fetch "$repository_path" git_branch_checkout "$repository_path" "$ORIGIN_HEAD" @@ -557,14 +557,14 @@ git_project_release() { shift local arguments=$@ - local repository_path=$( git_project_repository_path "$repository" ) + local repository_path=$(git_project_repository_path "$repository") local release_branch local branch=$project local argument for argument in "" "$@" do - if ! [ -z "$argument" ] + if [[ -n "$argument" ]] then branch="$branch-$argument" fi @@ -577,7 +577,7 @@ git_project_release() { release_branch=$branch done - if ! [ -z "$release_branch" ] + if [[ -n "$release_branch" ]] then local archive_path="$root/$RELEASE/$SOURCES/$project/$release_branch.$ARCHIVE" local sources_path="$root/$SOURCES/$repository" @@ -598,14 +598,14 @@ git_project_release_check() { local repository=$1 shift - local repository_path=$( git_project_repository_path "$repository" ) + local repository_path=$(git_project_repository_path "$repository") local release_branch local branch=$project local argument for argument in "" "$@" do - if ! [ -z "$argument" ] + if [[ -n "$argument" ]] then branch="$branch-$argument" fi @@ -618,13 +618,13 @@ git_project_release_check() { release_branch=$branch done - if ! [ -z "$release_branch" ] + if [[ -n "$release_branch" ]] then local archive_path="$root/$RELEASE/$SOURCES/$project/$release_branch.$ARCHIVE" file_exists_check "$archive_path" - if [ $? -ne 0 ] + if [[ $? -ne 0 ]] then return 1 else |