Skip to content

Commit

Permalink
Fix fetch() on git < 1.7.3
Browse files Browse the repository at this point in the history
Apparently these versions of git are broken for `git fetch $url`, so we have to
resort to `git fetch origin` and then just pray that it hasn't changed in the
meantime.
  • Loading branch information
alexcrichton committed Jul 1, 2014
1 parent 1bbcdcc commit 75ca63d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/cargo/sources/git/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,18 @@ impl GitCheckout {
// --tags on 1.9. For simplicity, we execute with and without --tags for
// all gits.
//
// FIXME: This is suspicious. I have been informated that, for example,
// FIXME: This is suspicious. I have been informed that, for example,
// bundler does not do this, yet bundler appears to work!
git!(self.location, "fetch --force --quiet {}",
self.get_source().display());
git!(self.location, "fetch --force --quiet --tags {}",
self.get_source().display());
//
// And to continue the fun, git before 1.7.3 had the fun bug that if a
// branch was tracking a remote, then `git fetch $url` doesn't work!
//

This comment has been minimized.

Copy link
@wycats

wycats Jul 1, 2014

Contributor

r+

// For details, see
// https://www.kernel.org/pub/software/scm/git/docs/RelNotes-1.7.3.txt
//
// In this case we just use `origin` here instead of the database path.
git!(self.location, "fetch --force --quiet origin");
git!(self.location, "fetch --force --quiet --tags origin");
try!(self.reset(self.revision.as_slice()));
Ok(())
}
Expand Down

6 comments on commit 75ca63d

@wycats
Copy link
Contributor

@wycats wycats commented on 75ca63d Jul 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

@bors
Copy link
Contributor

@bors bors commented on 75ca63d Jul 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from wycats
at alexcrichton@75ca63d

@bors
Copy link
Contributor

@bors bors commented on 75ca63d Jul 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging alexcrichton/cargo/fix-git-1.7 = 75ca63d into auto-cargo

@bors
Copy link
Contributor

@bors bors commented on 75ca63d Jul 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alexcrichton/cargo/fix-git-1.7 = 75ca63d merged ok, testing candidate = 9d040d4

@bors
Copy link
Contributor

@bors bors commented on 75ca63d Jul 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 75ca63d Jul 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto-cargo = 9d040d4

Please sign in to comment.