aboutsummaryrefslogtreecommitdiff
path: root/git-gui/.gitignore
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-03-20 21:20:42 -0400
committerJunio C Hamano <gitster@pobox.com>2017-03-21 11:12:52 -0700
commita1be47e4ca65718ec239e4b86a44e45220237aee (patch)
tree688e23ca3b924b229dbc2a8a94fdf4dab88ae294 /git-gui/.gitignore
parentc0f9c705890ac30871c70219c4b08d740fb40e2e (diff)
downloadgit-a1be47e4ca65718ec239e4b86a44e45220237aee.tar.gz
git-a1be47e4ca65718ec239e4b86a44e45220237aee.tar.xz
hash-object: fix buffer reuse with --path in a subdirectory
The hash-object command uses prefix_filename() without duplicating its return value. Since that function returns a static buffer, the value is overwritten by subsequent calls. This can cause incorrect results when we use --path along with hashing a file by its relative path, both of which need to call prefix_filename(). We overwrite the filename computed for --path, effectively ignoring it. We can fix this by calling xstrdup on the return value. Note that we don't bother freeing the "vpath" instance, as it remains valid until the program exit. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-gui/.gitignore')
0 files changed, 0 insertions, 0 deletions