summaryrefslogtreecommitdiff
path: root/git-gui/lib/commit.tcl
diff options
context:
space:
mode:
authorK Jayatheerth <jayatheerthkulkarni2005@gmail.com>2025-06-11 07:12:03 +0530
committerJunio C Hamano <gitster@pobox.com>2025-06-11 08:59:32 -0700
commitffb36c64f2b39833f1ac95b79d39c881ed60de24 (patch)
treeb4d90b0abcb8fe6f007bfee0ecca1a9a098f5e34 /git-gui/lib/commit.tcl
parentd50a5e8939abfc07c2ff97ae72e9330939b36ee0 (diff)
stash: fix incorrect branch name in stash message
When creating a stash, Git uses the current branch name of the superproject to construct the stash commit message. However, in repositories with submodules, the message may mistakenly display the submodule branch name instead. This is because `refs_resolve_ref_unsafe()` returns a pointer to a static buffer. Subsequent calls to the same function overwrite the buffer, corrupting the originally fetched `branch_name` used for the stash message. Use `xstrdup()` to duplicate the branch name immediately after resolving it, so that later buffer overwrites do not affect the stash message. Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-gui/lib/commit.tcl')
0 files changed, 0 insertions, 0 deletions