From: Pratyush Yadav Date: Fri, 27 Sep 2019 05:27:23 GMT Subject: Re: [PATCH 1/2] git-gui: use existing interface to query a path's attribute Message-ID: <20190927052723.4ttgxpqijqde57er@yadavpratyush.com> In-Reply-To: <97013a71289857767100d6a4adcb39ca99b2b21b.1569443729.git.bert.wesarg@googlemail.com> Looks good. Thanks. On 25/09/19 10:38PM, Bert Wesarg wrote: > Replace the hand-coded call to git check-attr with the already provided one. > > Signed-off-by: Bert Wesarg > --- > lib/diff.tcl | 15 +-------------- > 1 file changed, 1 insertion(+), 14 deletions(-) > > diff --git a/lib/diff.tcl b/lib/diff.tcl > index 958a0fa..0fd4600 100644 > --- a/lib/diff.tcl > +++ b/lib/diff.tcl > @@ -270,19 +270,6 @@ proc show_other_diff {path w m cont_info} { > } > } > > -proc get_conflict_marker_size {path} { > - set size 7 > - catch { > - set fd_rc [eval [list git_read check-attr "conflict-marker-size" -- $path]] > - set ret [gets $fd_rc line] > - close $fd_rc > - if {$ret > 0} { > - regexp {.*: conflict-marker-size: (\d+)$} $line line size > - } > - } > - return $size > -} > - > proc start_show_diff {cont_info {add_opts {}}} { > global file_states file_lists > global is_3way_diff is_submodule_diff diff_active repo_config > @@ -298,7 +285,7 @@ proc start_show_diff {cont_info {add_opts {}}} { > set is_submodule_diff 0 > set diff_active 1 > set current_diff_header {} > - set conflict_size [get_conflict_marker_size $path] > + set conflict_size [gitattr $path conflict-marker-size 7] > > set cmd [list] > if {$w eq $ui_index} { > -- > 2.21.0.789.ga095d9d866 > -- Regards, Pratyush Yadav