git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Prathamesh Chavan <pc44800@gmail.com>
Cc: git <git@vger.kernel.org>, Stefan Beller <sbeller@google.com>
Subject: Re: [GSoC][PATCH 5/6] submodule: port submodule subcommand sync from shell to C
Date: Thu, 22 Jun 2017 08:50:25 +0200	[thread overview]
Message-ID: <CAP8UFD3_toXcKzMmikkwaiGi7oHJ0BcT4s1fYe6hW4mYjUdmGA@mail.gmail.com> (raw)
In-Reply-To: <20170619215025.10086-5-pc44800@gmail.com>

On Mon, Jun 19, 2017 at 11:50 PM, Prathamesh Chavan <pc44800@gmail.com> wrote:

> +static char *get_up_path(const char *path)
> +{
> +       int i = count_slashes(path);
> +       struct strbuf sb = STRBUF_INIT;
> +
> +       while (i--)
> +               strbuf_addstr(&sb, "../");
> +
> +       /*
> +        *Check if 'path' ends with slash or not
> +        *for having the same output for dir/sub_dir
> +        *and dir/sub_dir/
> +        */
> +       if (!is_dir_sep(path[i - 1]))

i is always 0 here, as we decrease it until it gets to 0 above.

> +               strbuf_addstr(&sb, "../");
> +
> +       return strbuf_detach(&sb, NULL);
> +}

  parent reply	other threads:[~2017-06-22  6:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19 21:41 [GSoC] Update: Week 5 Prathamesh Chavan
2017-06-19 21:50 ` [GSoC][PATCH 1/6] dir: create function count_slashes Prathamesh Chavan
2017-06-19 21:50   ` [GSoC][PATCH 2/6] submodule--helper: introduce get_submodule_displaypath and for_each_submodule_list Prathamesh Chavan
2017-06-20 18:22     ` Brandon Williams
2017-06-22  7:01     ` Christian Couder
2017-06-19 21:50   ` [GSoC][PATCH 3/6] submodule: port set_name_rev from shell to C Prathamesh Chavan
2017-06-19 21:50   ` [GSoC][PATCH 4/6] submodule: port submodule subcommand status Prathamesh Chavan
2017-06-20 18:44     ` Brandon Williams
2017-06-19 21:50   ` [GSoC][PATCH 5/6] submodule: port submodule subcommand sync from shell to C Prathamesh Chavan
2017-06-20 17:35     ` Stefan Beller
2017-06-22  6:50     ` Christian Couder [this message]
2017-06-19 21:50   ` [GSoC][PATCH 6/6] submodule: port submodule subcommand 'deinit' " Prathamesh Chavan
2017-06-20 17:20   ` [GSoC][PATCH 1/6] dir: create function count_slashes Stefan Beller
2017-06-20  0:01 ` [GSoC] Update: Week 5 Andrew Ardill
2017-06-20  0:38   ` Brandon Williams
2017-06-26 23:24   ` Prathamesh Chavan

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=CAP8UFD3_toXcKzMmikkwaiGi7oHJ0BcT4s1fYe6hW4mYjUdmGA@mail.gmail.com \
    --to=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pc44800@gmail.com \
    --cc=sbeller@google.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).