-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"scalar unregister" cannot work against a registered but non-existing enlistment with its absolute path. #4200
Comments
I can reproduce this, but I cannot reproduce it in Git's test suite with this diff: diff --git a/t/t9210-scalar.sh b/t/t9210-scalar.sh
index 25f500cf682a..5697d350d3f4 100755
--- a/t/t9210-scalar.sh
+++ b/t/t9210-scalar.sh
@@ -119,7 +119,17 @@ test_expect_success 'scalar unregister' '
! grep -F "$(pwd)/vanish/src" scalar.repos &&
# scalar unregister should be idempotent
- scalar unregister vanish
+ scalar unregister vanish &&
+
+ # should also work with an absolute path
+ git init vanish/src &&
+ scalar register vanish/src &&
+ scalar list >scalar.repos &&
+ grep -F "$(pwd)/vanish/src" scalar.repos &&
+ rm -rf vanish &&
+ scalar unregister "$PWD/vanish" &&
+ scalar list >scalar.repos &&
+ ! grep -F "$(pwd)/vanish/src" scalar.repos
'
test_expect_success 'set up repository to clone' ' I suspect it might have something to do with |
Let's be careful to make this function work near the drive root: to resolve the drive root path itself, we _need_ a trailing backslash: if a file handle to the path `C:` is created, it does not actually refer to the drive root. Instead, it refers to this very Windows-only concept of a "per-drive current directory". This also requires the code that wants to re-append the last component to be more careful and only append a slash _if necessary_. This commit fixes the problem with `scalar unregister C:/foo` that was reported at git-for-windows#4200. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
And that's exactly what it was. #4253 has a fix for this, even if the description and the fix sound as if they are completely unrelated to Scalar. The root cause simply has nothing to do with Scalar 😁 |
/add relnote bug Some commands mishandled absolute paths near the drive root (e.g. The workflow run was started |
Some commands mishandled absolute paths near the drive root (e.g. C:/foo`](git-for-windows/git#4200)), which has Signed-off-by: gitforwindowshelper[bot] <gitforwindowshelper-bot@users.noreply.github.com>
/add relnote blurb As announced previously, Git for Windows will drop support for Windows 7 and for Windows 8 in one of the next versions, following Cygwin's and MSYS2's lead (Git for Windows relies on MSYS2 for components such as Bash and Perl). The workflow run was started |
Setup
defaults?
to the issue you're seeing?
Details
Minimal, Complete, and Verifiable example
this will help us understand the issue.
In Case 1, we can unregister an enlistment with its absolute path if the path exists.
In Case 2, we can unregister an enlistment with its relative path if the path exists.
In Case 3, we can unregister an enlistment with its relative path even if the path has been removed by
rm -rf
.In Case 4, we cannot unregister an enlistment with its absolute path if the path has been removed by
rm -rf
. The enlistment is expected to be unregistered. So far as I've tried, in order to unregister it, we have to re-create the path first, bymkdir -p /c/foo
orgit init /c/foo
. As in Case 3, we can also use its relative path.The command
scalar unregister /c/foo
does not unregister the enlistmentC:/foo
which has been removed byrm -rf
.URL to that repository to help us with testing?
It's not occurring with a specific repository.
The text was updated successfully, but these errors were encountered: