]> git.99rst.org Git - git.git/commit
stash: strip "refs/heads/" with skip_prefix
authorGlen Choo <redacted>
Mon, 24 Jan 2022 20:53:42 +0000 (12:53 -0800)
committerJunio C Hamano <redacted>
Thu, 24 Feb 2022 19:06:18 +0000 (11:06 -0800)
commitceaf037f617eb774bb8a451c1779dd9b8b12152a
tree4ece51fdb41cdf63a8257d1a848c67037eb532b7
parentdab1b7905d0b295f1acef9785bb2b9cbb0fdec84
stash: strip "refs/heads/" with skip_prefix

When generating a message for a stash, "git stash" only records the
part of the branch name to the right of the last "/". e.g. if HEAD is at
"foo/bar/baz", "git stash" generates a message prefixed with "WIP on
baz:" instead of "WIP on foo/bar/baz:".

Fix this by using skip_prefix() to skip "refs/heads/" instead of looking
for the last instance of "/".

Reported-by: Kraymer <redacted>
Reported-by: Daniel Hahler <redacted>
Helped-by: Jeff King <redacted>
Signed-off-by: Glen Choo <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/stash.c
t/t3903-stash.sh
git clone https://git.99rst.org/PROJECT