You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
I'm trying to use go-git (v4) to fetch from a remote into a bare repo, and I'm getting back an "already up-to-date" error even though I know for sure that the remote has new commits.
I was writing a test to see what happens when doing a non-fast-forwardable fetch (inspecting the code, I think there's a bug there too as it doesn't appear to check the fast-forward + in the refspec at all), but it seems there's a bigger issue fetching at all.
Here is a shell script to set up a repro (run it in a new test directory):
#!/usr/bin/env bash# Make bare repo
mkdir repo
cd repo
git init --bare
cd ..
# Make checkout and initialize remote repo
mkdir checkout
cd checkout
echotest>test
git init
git add test
git commit -m "test"
git remote add r ../repo
git push r master:master
cd ..
# Make a 2nd commit that's not pushed yetcd checkout
echo test2 > test2
git add test2
git commit -m "test2"cd ..
# Make a remote in the bare repocd repo
git remote add c $PWD/../checkout
Then, compile and run this Go program in the same directory:
The problem is not in the fetch itself, is because you are using, short refs in the refspec like "+master:master". This is not currently supported you must to use a full refspec such as +refs/heads/master:refs/remotes/origin/master.
Off the top of your head, will it reject non-fast-forward fetches without the +, the way it does on the command line? (I can file a separate issue for that if you want.)
I'm trying to use
go-git
(v4) to fetch from a remote into a bare repo, and I'm getting back an "already up-to-date" error even though I know for sure that the remote has new commits.I was writing a test to see what happens when doing a non-fast-forwardable fetch (inspecting the code, I think there's a bug there too as it doesn't appear to check the fast-forward
+
in the refspec at all), but it seems there's a bigger issue fetching at all.Here is a shell script to set up a repro (run it in a new test directory):
Then, compile and run this Go program in the same directory:
I get the output:
However, if you try it on the command line, this is the behavior:
Is go-git intended to be used to access bare repos? Am I doing something wrong? Thanks! And thanks for the great project.
The text was updated successfully, but these errors were encountered: