Thread (3 messages) 3 messages, 3 authors, 2019-03-03
  • (off-list ancestor, not in this archive)
  • Re: none · Junio C Hamano <hidden> · 2019-03-03
  • Clearing logic · Rohit Ashiwal <hidden> · 2019-03-03
  • Re: Clearing logic · Thomas Gummerer <hidden> · 2019-03-03

Clearing logic

From: Rohit Ashiwal <hidden>
Date: 2019-03-03 14:07:45

On 2019-03-03 13:33 UTC Junio C Hamano [off-list ref] wrote:
test -s <path> makes sure <path> is file; if it is not a file, then
it won't yield true.
On 2019-03-03 13:20 UTC Rohit Ashiwal [off-list ref] wrote:
quoted
test_path_is_file "$1" &&
	if ! test -s "$1"
According to the conditional if the path is not a file then we will get
the error "file does not exist" and then we will shortcircuit without checking
the second conditional, on the other hand, if path is a file then we will
again check if it has a size greater than zero, then error will be different
(if any).

Regards
Rohit
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help