From: Duy Nguyen <pclouds@gmail.com>
To: Stefan Beller <stefanbeller@googlemail.com>
Cc: Fredrik Gustafsson <iveqy@iveqy.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 2/4] backup_file dummy function
Date: Thu, 8 Aug 2013 09:45:46 +0700 [thread overview]
Message-ID: <CACsJy8BfUJL6C2tignfgP5iQq2Egz03ZL7vDvVBJpaFWtD3XNQ@mail.gmail.com> (raw)
In-Reply-To: <1375884049-14961-3-git-send-email-stefanbeller@googlemail.com>
On Wed, Aug 7, 2013 at 9:00 PM, Stefan Beller
<stefanbeller@googlemail.com> wrote:
> ---
> pack-write.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/pack-write.c b/pack-write.c
> index e6aa7e3..b728ea2 100644
> --- a/pack-write.c
> +++ b/pack-write.c
> @@ -344,6 +344,11 @@ struct sha1file *create_tmp_packfile(char **pack_tmp_name)
> return sha1fd(fd, *pack_tmp_name);
> }
>
> +void backup_file(char *filename)
> +{
> +
> +}
> +
I think the function looks like this (before it got lost after rebase)
+static void backup_file(const char *path)
+{
+ struct stat st;
+ if (repack_flags & REPACK_IN_PROGRESS &&
+ !stat(path, &st)) {
+ struct strbuf old = STRBUF_INIT;
+ strbuf_addf(&old, "%s.old", path);
+ if (rename(path, old.buf))
+ die_errno("unable to rename pack %s", path);
+ string_list_append(&backup_files, strbuf_detach(&old, NULL));
+ }
+}
+
--
Duy
next prev parent reply other threads:[~2013-08-08 2:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-02 13:48 Rewriting git-repack.sh in C Stefan Beller
2013-08-02 14:10 ` Duy Nguyen
2013-08-02 16:36 ` Duy Nguyen
2013-08-03 6:33 ` Fredrik Gustafsson
2013-08-03 10:03 ` Duy Nguyen
2013-08-07 14:00 ` [PATCH 0/4] " Stefan Beller
2013-08-07 14:00 ` [PATCH 1/4] Build in git-repack Stefan Beller
2013-08-07 14:28 ` Matthieu Moy
2013-08-07 15:48 ` Junio C Hamano
2013-08-07 16:45 ` Stefan Beller
2013-08-08 2:44 ` Duy Nguyen
2013-08-07 14:00 ` [PATCH 2/4] backup_file dummy function Stefan Beller
2013-08-08 2:45 ` Duy Nguyen [this message]
2013-08-07 14:00 ` [PATCH 3/4] pack-objects: do not print usage when repacking Stefan Beller
2013-08-08 6:40 ` Antoine Pelisse
2013-08-07 14:00 ` [PATCH 4/4] repack: add unpack-unreachable Stefan Beller
2013-08-05 10:34 ` Rewriting git-repack.sh in C Matthieu Moy
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACsJy8BfUJL6C2tignfgP5iQq2Egz03ZL7vDvVBJpaFWtD3XNQ@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=iveqy@iveqy.com \
--cc=stefanbeller@googlemail.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).