diff mbox

[6/6] dim: Don't try to create branches in update_branches

Message ID 20170126091049.9122-6-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter Jan. 26, 2017, 9:10 a.m. UTC
Avoids sprawnling branches everywhere, and makes the script faster for
folks who don't need everything. We already skip remotes, so this is
in line with what's there.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 dim | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Jani Nikula Jan. 26, 2017, 10:47 a.m. UTC | #1
On Thu, 26 Jan 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Avoids sprawnling branches everywhere, and makes the script faster for
> folks who don't need everything. We already skip remotes, so this is
> in line with what's there.

Seems okay. LGTM.

BR,
Jani.

>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  dim | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/dim b/dim
> index c5c46e9c767a..3991312ee310 100755
> --- a/dim
> +++ b/dim
> @@ -1312,6 +1312,9 @@ function dim_update_branches
>  	assert_repo_clean
>  
>  	for branch in $dim_branches ; do
> +		if ! git_branch_exists $branch ; then
> +			continue
> +		fi
>  		dim_checkout $branch
>  		repo=`branch_to_repo $branch`
>  		remote=`repo_to_remote $repo`
> @@ -1320,8 +1323,10 @@ function dim_update_branches
>  			$DRY git rebase -i
>  		fi
>  	done
> -	dim_checkout drm-intel-next
> -	$DRY git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-next
> +	if git_branch_exists drm-intel-next ; then
> +		dim_checkout drm-intel-next
> +		$DRY git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-next
> +	fi
>  
>  	cd $DIM_PREFIX/maintainer-tools
>  	if git_is_current_branch maintainer-tools ; then
diff mbox

Patch

diff --git a/dim b/dim
index c5c46e9c767a..3991312ee310 100755
--- a/dim
+++ b/dim
@@ -1312,6 +1312,9 @@  function dim_update_branches
 	assert_repo_clean
 
 	for branch in $dim_branches ; do
+		if ! git_branch_exists $branch ; then
+			continue
+		fi
 		dim_checkout $branch
 		repo=`branch_to_repo $branch`
 		remote=`repo_to_remote $repo`
@@ -1320,8 +1323,10 @@  function dim_update_branches
 			$DRY git rebase -i
 		fi
 	done
-	dim_checkout drm-intel-next
-	$DRY git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-next
+	if git_branch_exists drm-intel-next ; then
+		dim_checkout drm-intel-next
+		$DRY git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-next
+	fi
 
 	cd $DIM_PREFIX/maintainer-tools
 	if git_is_current_branch maintainer-tools ; then