diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-09-12 14:08:05 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-12 14:08:05 -0700 |
commit | 3503e9ab32c7a478d0d985171c50a901a2695162 (patch) | |
tree | 3fdddd11cc1cfe64e0d69c0ebcc92eac8dc77ced /revision.c | |
parent | cbd6b089e821a4ff35970531b26e64a2e621ff04 (diff) | |
parent | 1403db49b80630cf8c36ba3e8b0f085ea0ab8286 (diff) | |
download | git-3503e9ab32c7a478d0d985171c50a901a2695162.tar.gz |
Merge branch 'maint-1.7.11' into maint
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/revision.c b/revision.c index 442a945233..cbcae1086b 100644 --- a/revision.c +++ b/revision.c @@ -1134,15 +1134,27 @@ int handle_revision_arg(const char *arg_, struct rev_info *revs, int flags, unsi const char *this = arg; int symmetric = *next == '.'; unsigned int flags_exclude = flags ^ UNINTERESTING; + static const char head_by_default[] = "HEAD"; unsigned int a_flags; *dotdot = 0; next += symmetric; if (!*next) - next = "HEAD"; + next = head_by_default; if (dotdot == arg) - this = "HEAD"; + this = head_by_default; + if (this == head_by_default && next == head_by_default && + !symmetric) { + /* + * Just ".."? That is not a range but the + * pathspec for the parent directory. + */ + if (!cant_be_filename) { + *dotdot = '.'; + return -1; + } + } if (!get_sha1_committish(this, from_sha1) && !get_sha1_committish(next, sha1)) { struct commit *a, *b; |