Re: [RFC/PATCH] commit: allow partial commits with relative paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 27, 2011 at 12:19 PM, John Szakmeister <john@xxxxxxxxxxxxxxx> wrote:
> On Wed, Jul 27, 2011 at 5:53 AM, Michael J Gruber
> <git@xxxxxxxxxxxxxxxxxxxx> wrote:
> [snip]
>> I can't reproduce that name truncation with a current git, btw. (So I
>> won't bother bisecting where we removed a spurious offset by "prefix".)
>
> I can:
>
> :: git --version
> git version 1.7.6.347.g4db0d
> :: git init reproduce-bug
> Initialized empty Git repository in /Users/jszakmeister/tmp/reproduce-bug/.git/
> :: cd reproduce-bug
> :: echo foo > foo.txt
> :: mkdir bar
> :: echo bar bar/bar.txt
> bar bar/bar.txt
> :: git add .
> :: git commit -m '.'
> [master (root-commit) a5f76f1] .
>  2 files changed, 2 insertions(+), 0 deletions(-)
>  create mode 100644 bar/bar.txt
>  create mode 100644 foo.txt
> :: cd bar
> :: git rm ../foo.txt
> rm 'foo.txt'
> :: git commit ../foo.txt
> error: pathspec 'txt' did not match any file(s) known to git.

What seems to happen here, is report_path_error gets called with a
pathspec that doesn't contain the prefix (which is "bar/"), yet it
tries to skip prefix_len characters ahead in it when reporting.

Why the pathspec isn't prefixed by "bar/" is because of the
normalize_path_copy-call in prefix_path, when called through
get_pathspec("bar/", {"../foo.txt", NULL}).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]