git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/4] is_directory(): a generic helper function
Date: Tue, 09 Sep 2008 12:31:39 +0200	[thread overview]
Message-ID: <48C6508B.1080600@viscovery.net> (raw)
In-Reply-To: <1220948830-3275-2-git-send-email-gitster@pobox.com>

Junio C Hamano schrieb:
> +/*
> + * Do not use this for inspecting *tracked* content.  When path is a
> + * symlink to a directory, we do not want to say it is a directory.

I though stat(2) checks the thing that a symlink points to. Then either
this comment is not correct or you want to use lstat(2), no?

> + * Worth yet, leading components in path could contain symbolic links.
> + */
> +int is_directory(const char *path)
> +{
> +	struct stat st;
> +	return (!stat(path, &st) && S_ISDIR(st.st_mode));
> +}

-- Hannes

  parent reply	other threads:[~2008-09-09 10:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09  8:27 [PATCH 0/4] Pushing into a repository with alternates Junio C Hamano
2008-09-09  8:27 ` [PATCH 1/4] is_directory(): a generic helper function Junio C Hamano
2008-09-09  8:27   ` [PATCH 2/4] receive-pack: make it a builtin Junio C Hamano
2008-09-09  8:27     ` [PATCH 3/4] push: prepare sender to receive extended ref information from the receiver Junio C Hamano
2008-09-09  8:27       ` [PATCH 4/4] push: receiver end advertises refs from alternate repositories Junio C Hamano
2008-09-09 13:03       ` [PATCH 3/4] push: prepare sender to receive extended ref information from the receiver Jeff King
2008-09-09  9:26     ` [PATCH 2/4] receive-pack: make it a builtin Paolo Bonzini
2008-09-09 14:24       ` Junio C Hamano
2008-09-09 14:47         ` Paolo Bonzini
2008-09-09 10:31   ` Johannes Sixt [this message]
2008-09-09 12:32     ` [PATCH 1/4] is_directory(): a generic helper function Jeff King
2008-09-09 14:51       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C6508B.1080600@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).