From 5193aae385bd4fe3c63f04c8424ac30bea69cce8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Jan 2021 12:22:48 -0400 Subject: [PATCH] Bug fix: Fix tilde expansion in ssh urls when the tilde is the last character in the url. Thanks, Grond for the patch. --- CHANGELOG | 3 +++ Git/Construct.hs | 1 + .../__91__PATCH__93___incorrect_behaviour_in_expandTilde.mdwn | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index bf34053c93..6fa41b9f72 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -25,6 +25,9 @@ git-annex (8.20201130) UNRELEASED; urgency=medium Thanks, Kyle Meyer for the patch. * Windows: Work around win32 length limits when dealing with lock files. * Bug fix: export with -J could fail when two files had the same content. + * Bug fix: Fix tilde expansion in ssh urls when the tilde is the last + character in the url. + Thanks, Grond for the patch. -- Joey Hess Mon, 04 Jan 2021 12:52:41 -0400 diff --git a/Git/Construct.hs b/Git/Construct.hs index 8b63ac4802..a369bc4a66 100644 --- a/Git/Construct.hs +++ b/Git/Construct.hs @@ -187,6 +187,7 @@ expandTilde = expandt True expandt True ('~':'/':cs) = do h <- myHomeDir return $ h cs + expandt True "~" = myHomeDir expandt True ('~':cs) = do let (name, rest) = findname "" cs u <- getUserEntryForName name diff --git a/doc/bugs/__91__PATCH__93___incorrect_behaviour_in_expandTilde.mdwn b/doc/bugs/__91__PATCH__93___incorrect_behaviour_in_expandTilde.mdwn index 9e965967c8..c3211cd7a4 100644 --- a/doc/bugs/__91__PATCH__93___incorrect_behaviour_in_expandTilde.mdwn +++ b/doc/bugs/__91__PATCH__93___incorrect_behaviour_in_expandTilde.mdwn @@ -140,3 +140,5 @@ local repository version: 5 ### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders) Definitely! I'm currently writing some personal file synchronization software that uses git-annex for myself, which is how I noticed this bug. + +> Thanks for a perfect bug report and patch. [[done]] --[[Joey]]