]> source.dussan.org Git - jgit.git/commitdiff
Correct fetch to use fetch.fsckObjects and transfer.fsckObjects 89/23289/2
authorShawn Pearce <spearce@spearce.org>
Wed, 12 Mar 2014 23:53:26 +0000 (16:53 -0700)
committerShawn Pearce <spearce@spearce.org>
Thu, 13 Mar 2014 00:15:41 +0000 (17:15 -0700)
git-core configures fsck during fetch using these two variables.
JGit use of fsck in fetch predates the usage in git-core and had
reused receive.fsckobjects, which does not match behavior.

Change-Id: Ie4d5f082258c4b2928c7ecc3780c6363fa587f34

org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java

index 3a08cd35dfe014bb61767739c7ff29cc6de1110d..b00d607eee2ed829d5ebf8caf77410580efb4480 100644 (file)
@@ -63,7 +63,7 @@ public class TransferConfig {
                }
        };
 
-       private final boolean fsckObjects;
+       private final boolean fetchFsck;
        private final boolean allowTipSha1InWant;
        private final String[] hideRefs;
 
@@ -72,7 +72,10 @@ public class TransferConfig {
        }
 
        private TransferConfig(final Config rc) {
-               fsckObjects = rc.getBoolean("receive", "fsckobjects", false); //$NON-NLS-1$ //$NON-NLS-2$
+               fetchFsck = rc.getBoolean(
+                               "fetch", "fsckobjects", //$NON-NLS-1$ //$NON-NLS-2$
+                               rc.getBoolean("transfer", "fsckobjects", false)); //$NON-NLS-1$ //$NON-NLS-2$
+
                allowTipSha1InWant = rc.getBoolean(
                                "uploadpack", "allowtipsha1inwant", false); //$NON-NLS-1$ //$NON-NLS-2$
                hideRefs = rc.getStringList("uploadpack", null, "hiderefs"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -82,7 +85,7 @@ public class TransferConfig {
         * @return strictly verify received objects?
         */
        public boolean isFsckObjects() {
-               return fsckObjects;
+               return fetchFsck;
        }
 
        /**