Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-12-14 21:21:36 +0300
committerJunio C Hamano <gitster@pobox.com>2020-12-14 21:21:36 +0300
commitc59b73bef302f4efd0f853f913328aab534b1f1a (patch)
tree211c4bf2f2d168bdd46d03a6e821e5b5555cc732 /refspec.c
parent78abcff222d2d9cb05776bac39f7dc6a84b8f809 (diff)
parent374fbaef3df8f05acf9968fc38c6da72a62bcfc2 (diff)
Merge branch 'fc/atmark-in-refspec'
"@" sometimes worked (e.g. "git push origin @:there") as a part of a refspec element, but "git push origin @" did not work, which has been corrected. * fc/atmark-in-refspec: refspec: make @ a synonym of HEAD tests: push: trivial cleanup tests: push: improve cleanup of HEAD tests
Diffstat (limited to 'refspec.c')
-rw-r--r--refspec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/refspec.c b/refspec.c
index d4823dbff9..e3d852c0bf 100644
--- a/refspec.c
+++ b/refspec.c
@@ -71,7 +71,10 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet
}
item->pattern = is_glob;
- item->src = xstrndup(lhs, llen);
+ if (llen == 1 && *lhs == '@')
+ item->src = xstrdup("HEAD");
+ else
+ item->src = xstrndup(lhs, llen);
flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0);
if (item->negative) {