summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-07-10 20:40:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-07-10 21:16:41 (GMT)
commitea2d4ed35902ce15959965ab86d80527731a177c (patch)
tree4512fb08e9c98c699f40e59a1fbbe8002ce54ea1 /builtin/commit.c
parentcbcab75c54b5956dcaa4f24a4074bc99adc49629 (diff)
downloadgit-ea2d4ed35902ce15959965ab86d80527731a177c.zip
git-ea2d4ed35902ce15959965ab86d80527731a177c.tar.gz
git-ea2d4ed35902ce15959965ab86d80527731a177c.tar.bz2
commit: fix "--amend --only" with no pathspec
When we do not have any pathspec, we typically disallow an explicit "--only", because it makes no sense (your commit would, by definition, be empty). But since 6a74642 (git-commit --amend: two fixes., 2006-04-20), we have allowed "--amend --only" with the intent that it would amend the commit, ignoring any contents staged in the index. However, while that commit allowed the combination, we never actually implemented the logic to make it work. The current code notices that we have no pathspec and assumes we want to do an as-is commit (i.e., the "--only" is ignored). Instead, we must make sure to follow the partial-commit code-path. We also need to tweak the list_paths function to handle a NULL pathspec. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions