git fetch --dry-run changes the local repo and transfers data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to test if a remote repo has a given SHA. `ls-remote` does
not work for this unless it is a tag or a HEAD (which is not
guaranteed for this case).

`git fetch --dry-run $remote $rev` SEEMS to fit the bill, except it
changes local state. For example:

```
$ git cat-file -t f80f1b23b4cab2a295a091c623bb4746d188bd4a
fatal: git cat-file: could not get object info

$ git rev-parse FETCH_HEAD
42d21cf12aab73ac8bc6245cc74ac9850bdf6989

$ git fetch --dry-run file:///tmp/e2e.2527526915/repo
f80f1b23b4cab2a295a091c623bb4746d188bd4a
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 18 (delta 6), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (18/18), 415.91 KiB | 84.00 KiB/s, done.
>From file:///tmp/e2e.2527526915/repo
 * branch            f80f1b23b4cab2a295a091c623bb4746d188bd4a -> FETCH_HEAD

$ git cat-file -t f80f1b23b4cab2a295a091c623bb4746d188bd4a
commit

$ git rev-parse FETCH_HEAD
42d21cf12aab73ac8bc6245cc74ac9850bdf6989
```

FETCH_HEAD was not updated (good) but the rev in question is now
present locally (bad), further tested by making a very large commit
and watching the fetch be very slow.  Also the same on non file://
repo (I tried https)

Am I using --dry-run wrong (or misunderstanding its purpose)?

Tim



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux