From: "Tim Abell" <tim@timwise.co.uk>
To: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Handle rename of case only, for Windows
Date: Sun, 30 Jan 2011 16:53:55 +0000 [thread overview]
Message-ID: <1296406435.8170.1418006125@webmail.messagingengine.com> (raw)
In-Reply-To: <4D44CB60.8000506@lsrfire.ath.cx>
> + struct stat src_st;
> + lstat(src, &src_st);
Shouldn't you check the return value of this call? OK, the source
probably always exists, but still. Oh, we actually know that because
that's the first lstat() call in this for loop. You can reuse its
result instead of calling the function again.
Thanks for your feedback, you are undoubtedly right about checking the return value, I hadn't though of that. Just out of interest I tried moving a file with git mv that i'd removed from the filesystem. Here's the result, so at least it's not dying horribly:
$ rm foo.txt
$ git status
# On branch master
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: foo.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git mv foo.txt bar.txt
fatal: bad source, source=foo.txt, destination=bar.txt
--
What do I need to do from here to make my patch acceptable/useful to git's maintainers?
Thanks
Tim Abell
next prev parent reply other threads:[~2011-01-30 16:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-29 23:45 [PATCH] Handle rename of case only, for Windows Tim Abell
2011-01-30 2:22 ` René Scharfe
2011-01-30 16:53 ` Tim Abell [this message]
2011-01-30 21:39 ` Jonathan Nieder
2011-02-10 18:58 ` Ramsay Jones
-- strict thread matches above, loose matches on Subject: below --
2011-01-14 13:44 [PATCH] handle rename of case only, for windows Tim Abell
2011-01-14 14:17 ` Nguyen Thai Ngoc Duy
2011-01-14 13:41 Tim Abell
2011-01-14 14:22 ` Erik Faye-Lund
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=1296406435.8170.1418006125@webmail.messagingengine.com \
--to=tim@timwise.co.uk \
--cc=git@vger.kernel.org \
--cc=rene.scharfe@lsrfire.ath.cx \
/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).