Skip to content

regression in 0.5.4 from 0.5.2: removed files now break 'git lfs fetch' #588

Closed

Description

@jsh

If I put files into git-lfs, remove some, then run "git lfs fetch" the git-lfs client now errors out. In 0.5.2, it didn't. This bit us, but I don't know which you want it to do, so I'll just file this as a regression.

Patient: "Doctor, it hurts when I do this."
Doctor: "Then don't do it."

To reproduce the problem:

(1) Run the setup script, below, to create a repo with the right structure
(2) Go into the local clone (scratchdir/), and type "git lfs fetch." With git-lfs 0.5.2, everyone's still happy. With 0.5.4, not so much.

I've separated it out into two steps so you can go into the directory and poke around before triggering the error.

I can't seem to attach the setup script, so I'll just paste it in. Sigh. :-)


#!/bin/bash -eu

git-scratchdir() {
  dir=scratchdir
  rm -rf $dir /tmp/$dir.git
  git init $dir
  pushd $_
  touch .gitkeep; git add $_; git commit -am"initial"
  popd
  git clone --bare file://$PWD/$dir /tmp/$dir.git
  rm -rf $dir
  git clone ssh://localhost/tmp/$dir.git
}

# create a scratch repo with a remote
git-scratchdir
cd scratchdir

# set git-lfs up to track files called <whatever>.big
bigfiles='*.big'
git lfs track "$bigfiles"
git add .gitattributes
git commit -m"track files with the extension '$bigfiles'"
git push

# now create some
for i in babe bunyan; do
  echo "this is big file $i.big" > $i.big
done
git add *.big
git commit -m'a pair of big files'
git push

# delete one
git rm bunyan.big
git commit -m"only big oxen, not big humans"
git push

Activity

  1. jsh commented on Aug 14, 2015

    @jsh
    Author

    Heck. I forgot this was markdown. Sorry. Fixed now. :-)

  2. technoweenie commented on Aug 17, 2015

    @technoweenie
    Contributor

    I wrote a failing test for v0.5.x (#590) and ensured that it's fixed in master. I think we can fix it by backporting the lfs.ScanTree() function that we have in master. The problem is that the current ScanRef() is finding deleted objects too.

  3. technoweenie commented on Nov 16, 2015

    @technoweenie
    Contributor

    This is old, just upgrade to v1.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions