Re: [PATCH] git-gui: a minor fix in procedure show_diff{}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michele Ballabio <barra_cuda@xxxxxxxxxxxx> wrote:
> git-gui has a minor problem with regards to symlinks that point
> to directories.

Whoops.  Your patch obviously fixes this problem.  Applied to maint.
 
> Another (similar) minor problem can be seen with:
> 
> 	git init
> 	mkdir git_dir
> 	cd git_dir
> 	git init
> 	echo file > file
> 	git add file
> 	git commit -a -m "commit"
> 	cd ..
> 	git-gui
> 
> I.e. directories containing a git repo show up in git-gui as
> empty, triggering the error shown above.
> 
> I don't know the right fix for this, though. I suspect git-submodule
> should be involved.

I think I got this working, its actually a couple of patches.
I'll post it to the list in a minute, but will also include
them into maint.

>  		if {[catch {
>  				set fd [open $path r]
>  				fconfigure $fd -eofchar {}
> -				set content [read $fd $max_sz]
> +				if {[file type $path] == "link"} {
> +					set content [file readlink $path]
> +				} else {
> +					set content [read $fd $max_sz]
> +				}
>  				close $fd
>  				set sz [file size $path]
>  			} err ]} {

I slightly reorganized this block when I applied your patch; if
[file type $path] == "link" then there is no reason for us to
open it.  So I moved the open part down into the else clause,
where we do the read.

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux